/* ===========================
   Open Badges — Public CSS
   =========================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --danger: #e53e3e;
    --text: #2d3748;
    --text-light: #718096;
    --bg: #f7fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
}

body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* Navbar */
.navbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.nav-logo img { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-link { text-decoration: none; color: var(--text-light); font-size: 0.95rem; transition: color 0.2s; }
.nav-link:hover { color: var(--primary); }
.btn-nav-cta { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 0.5rem 1.2rem; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* Hero */
.hero { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 5rem 1.5rem; display: flex; align-items: center; justify-content: center; gap: 4rem; min-height: 500px; }
.hero-content { max-width: 560px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin: 0 0 1rem; }
.highlight { background: rgba(255,255,255,0.2); border-radius: 8px; padding: 0 0.3em; }
.hero-sub { font-size: 1.15rem; opacity: 0.9; margin: 0 0 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-primary { background: #fff; color: var(--primary); padding: 0.75rem 1.5rem; border-radius: 10px; text-decoration: none; font-weight: 700; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem; transition: transform 0.2s; }
.btn-primary:hover { transform: translateY(-2px); }
.btn-secondary { background: rgba(255,255,255,0.15); color: #fff; padding: 0.75rem 1.5rem; border-radius: 10px; text-decoration: none; font-weight: 600; border: 2px solid rgba(255,255,255,0.4); display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-secondary:hover { background: rgba(255,255,255,0.25); }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); padding: 0.5rem 1rem; border-radius: 8px; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 0.5rem; }

/* Badge demo grid */
.hero-visual { display: flex; }
.badge-demo-grid { display: grid; grid-template-columns: repeat(2, 120px); gap: 1rem; }
.badge-demo { background: rgba(255,255,255,0.15); border: 2px solid rgba(255,255,255,0.3); border-radius: 16px; width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; font-size: 2rem; color: #fff; backdrop-filter: blur(10px); }
.badge-demo span { font-size: 0.75rem; font-weight: 600; opacity: 0.9; }

/* Features */
.features { padding: 5rem 0; }
.features h2, .how-it-works h2, .verify-section h2 { text-align: center; font-size: 2rem; margin: 0 0 2.5rem; color: var(--text); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--card-bg); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); text-align: center; }
.feature-icon { width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #fff; margin: 0 auto 1rem; }
.feature-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.feature-card p { margin: 0; color: var(--text-light); font-size: 0.95rem; }

/* How it works */
.how-it-works { background: linear-gradient(135deg, #f6f9fc, #eef2ff); padding: 5rem 0; }
.steps { display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.step { text-align: center; max-width: 200px; }
.step-num { width: 56px; height: 56px; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 800; margin: 0 auto 1rem; }
.step h3 { margin: 0 0 0.5rem; }
.step p { margin: 0; color: var(--text-light); font-size: 0.9rem; }
.step-arrow { color: var(--primary); font-size: 1.5rem; }

/* Verify section */
.verify-section { padding: 4rem 0; text-align: center; }
.verify-form { display: flex; gap: 0.5rem; max-width: 600px; margin: 0 auto; }
.verify-form input { flex: 1; padding: 0.75rem 1rem; border: 2px solid var(--border); border-radius: 10px; font-size: 1rem; }
.verify-form button { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: none; padding: 0.75rem 1.5rem; border-radius: 10px; cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

/* Badge verify page */
.badge-verify-page { max-width: 700px; margin: 3rem auto; padding: 0 1.5rem; }
.badge-verify-card { background: var(--card-bg); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.verify-status { padding: 1rem 2rem; display: flex; align-items: center; gap: 0.75rem; font-weight: 700; font-size: 1.05rem; }
.verify-status.valid { background: #f0fff4; color: #22543d; border-bottom: 2px solid var(--success); }
.verify-status.revoked { background: #fff5f5; color: #742a2a; border-bottom: 2px solid var(--danger); }
.badge-hero { padding: 2.5rem; text-align: center; background: linear-gradient(135deg, #f6f9fc, #eef2ff); }
.badge-image { max-width: 200px; height: 200px; object-fit: contain; border-radius: 16px; box-shadow: 0 8px 32px rgba(102,126,234,0.2); }
.badge-placeholder { width: 160px; height: 160px; background: var(--bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto; color: var(--primary); }
.badge-title { font-size: 1.8rem; font-weight: 800; text-align: center; margin: 0 2rem 0.5rem; }
.badge-description { text-align: center; color: var(--text-light); margin: 0 2rem 1.5rem; }
.badge-meta { padding: 0 2rem; }
.meta-row { display: flex; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--border); font-size: 0.95rem; }
.meta-label { color: var(--text-light); display: flex; align-items: center; gap: 0.5rem; }
.meta-value { font-weight: 600; text-align: right; }
.meta-value a { color: var(--primary); text-decoration: none; }
.badge-actions-bar { display: flex; gap: 0.75rem; padding: 1.5rem 2rem; flex-wrap: wrap; }
.btn-action { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 0.6rem 1.2rem; border-radius: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.btn-action-outline { border: 2px solid var(--primary); color: var(--primary); padding: 0.6rem 1.2rem; border-radius: 8px; text-decoration: none; font-size: 0.9rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }
.verify-url-box { padding: 1.5rem 2rem 2rem; }
.verify-url-box label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 0.5rem; display: block; }
.url-copy { display: flex; gap: 0.5rem; }
.url-copy input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem; background: var(--bg); }
.btn-copy { background: var(--primary); color: #fff; border: none; padding: 0.5rem 0.75rem; border-radius: 8px; cursor: pointer; }

/* Profile page */
.profile-page { max-width: 900px; margin: 3rem auto; padding: 0 1.5rem; }
.profile-header { display: flex; align-items: center; gap: 2rem; background: var(--card-bg); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); margin-bottom: 2rem; }
.profile-avatar img { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; }
.avatar-placeholder { width: 100px; height: 100px; background: linear-gradient(135deg, var(--primary), var(--secondary)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; }
.profile-info h1 { margin: 0 0 0.25rem; font-size: 1.8rem; }
.profile-username { margin: 0; color: var(--text-light); }
.profile-badge-count { margin: 0.5rem 0 0; color: var(--primary); font-weight: 600; }

/* Issuer page */
.issuer-page { max-width: 900px; margin: 3rem auto; padding: 0 1.5rem; }
.issuer-header { display: flex; align-items: center; gap: 2rem; background: var(--card-bg); border-radius: 20px; padding: 2rem; box-shadow: var(--shadow); margin-bottom: 2rem; }
.issuer-logo, .issuer-logo-placeholder { width: 80px; height: 80px; object-fit: contain; border-radius: 12px; }
.issuer-logo-placeholder { background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.issuer-stats { display: flex; gap: 1.5rem; margin-top: 0.75rem; color: var(--text-light); font-size: 0.95rem; }
.issuer-stats span { display: flex; align-items: center; gap: 0.4rem; }
.issuer-badges h2 { font-size: 1.4rem; margin: 0 0 1.5rem; }

/* Badges grid */
.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; }
.badge-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
.badge-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.badge-card-link { text-decoration: none; color: inherit; }
.badge-img { height: 140px; background: linear-gradient(135deg, #f6f9fc, #eef2ff); display: flex; align-items: center; justify-content: center; color: var(--primary); }
.badge-img img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.badge-info { padding: 1rem; }
.badge-info h3 { margin: 0 0 0.25rem; font-size: 0.95rem; font-weight: 700; }
.badge-issuer, .badge-date, .badge-domain, .badge-desc, .issued-count { margin: 0.2rem 0 0; font-size: 0.8rem; color: var(--text-light); display: flex; align-items: center; gap: 0.3rem; }

/* Empty state */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-light); }
.empty-state i { margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { margin: 0 0 0.5rem; color: var(--text); }
.empty-state p { margin: 0 0 1.5rem; }

/* Alerts */
.alert { padding: 1rem 1.5rem; border-radius: 10px; margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
.alert-error { background: #fff5f5; color: #742a2a; border-left: 4px solid var(--danger); }
.alert-success { background: #f0fff4; color: #22543d; border-left: 4px solid var(--success); }
.alert-info { background: #ebf8ff; color: #2c5282; border-left: 4px solid #3182ce; }

/* Footer */
.public-footer { background: var(--text); color: rgba(255,255,255,0.6); text-align: center; padding: 2rem; margin-top: 4rem; }
.public-footer a { color: rgba(255,255,255,0.8); }

@media (max-width: 768px) {
    .hero { flex-direction: column; padding: 3rem 1.5rem; gap: 2rem; }
    .hero h1 { font-size: 2rem; }
    .hero-visual { display: none; }
    .steps { flex-direction: column; }
    .step-arrow { transform: rotate(90deg); }
    .badge-verify-page, .profile-page, .issuer-page { margin: 1.5rem auto; }
    .profile-header, .issuer-header { flex-direction: column; text-align: center; }
    .meta-row { flex-direction: column; gap: 0.25rem; }
    .badge-actions-bar { justify-content: center; }
}
