/* ==========================================================================
   AIFA — Institutional theme
   Palette: deep ink, gold accent (Angola-inspired), clean neutrals
   ========================================================================== */

:root {
    --ink: #0e1220;
    --ink-2: #171d31;
    --gold: #e8b53a;
    --gold-2: #c9971f;
    --red: #c8203a;
    --paper: #ffffff;
    --paper-2: #f6f7fb;
    --line: #e4e7f0;
    --text: #1c2230;
    --muted: #6b7280;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 10px 40px -12px rgba(14, 18, 32, .18);
    --shadow-sm: 0 4px 18px -8px rgba(14, 18, 32, .22);
    --container: 1180px;
    --sans: 'Inter', system-ui, sans-serif;
    --display: 'Sora', var(--sans);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
}
.container.narrow { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }

h1, h2, h3, h4 { font-family: var(--display); line-height: 1.15; color: var(--ink); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-family: var(--sans);
    padding: 13px 24px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    font-size: .95rem;
    white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn-primary { background: var(--gold); color: #1a1400; border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-2); border-color: var(--gold-2); transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(201,151,31,.6); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-outline:hover { background: #fff; color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(14, 18, 32, .96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; line-height: 1; flex-shrink: 0; }
.brand-logo { height: 30px; width: auto; max-width: 150px; object-fit: contain; display: block; }
.brand-mark {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.5rem;
    color: #fff;
    letter-spacing: 1px;
}
.brand-mark::after { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; margin-left: 4px; }
.brand-sub { font-size: .62rem; color: #9aa3b8; letter-spacing: .4px; text-transform: uppercase; white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: 18px; }
.main-nav > a {
    color: #cdd3e2;
    font-size: .9rem;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
    white-space: nowrap;
    transition: color .2s;
}
.main-nav > a:hover { color: #fff; }
.main-nav > a.active { color: var(--gold); }
.main-nav > a.active::after {
    content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 2px; background: var(--gold); border-radius: 2px;
}

.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 6px; font-size: .8rem; }
.lang-switch a { color: #7f889e; padding: 4px 7px; border-radius: 6px; font-weight: 600; }
.lang-switch a.active { color: #fff; background: rgba(255,255,255,.12); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { width: 26px; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }

/* ---------- Hero ---------- */
.hero {
    background: radial-gradient(1200px 500px at 80% -10%, rgba(232,181,58,.14), transparent 60%), var(--ink);
    color: #fff;
    overflow: hidden;
}
.hero-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 90px 24px 100px;
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    align-items: center;
    gap: 40px;
}
.eyebrow { display: inline-block; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); font-weight: 600; margin-bottom: 18px; }
.hero-text h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); color: #fff; font-weight: 800; margin-bottom: 20px; }
.hero-text p { color: #b9c0d4; font-size: 1.1rem; max-width: 560px; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.hero-cta .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); transform: translateY(-2px); }

.hero-visual { display: flex; justify-content: center; }
.wave { display: flex; align-items: center; gap: 5px; height: 220px; }
.wave span {
    width: 6px;
    background: linear-gradient(var(--gold), var(--gold-2));
    border-radius: 6px;
    animation: bounce 1.4s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.08s);
    height: 30%;
    opacity: .85;
}
@keyframes bounce { 0%,100%{ height: 18%; } 50%{ height: 92%; } }

/* ---------- Services cards ---------- */
.services { padding: 70px 0; background: var(--paper-2); }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 26px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card-icon {
    width: 52px; height: 52px; border-radius: 13px;
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: #1a1400; display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
}
.card h3 { font-size: 1.12rem; }
.card p { color: var(--muted); font-size: .93rem; flex-grow: 1; }
.card-link { color: var(--gold-2); font-weight: 600; font-size: .9rem; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 36px; }
.section-head h2 { font-size: 2rem; }
.link-more, .link-back { color: var(--gold-2); font-weight: 600; }
.lead { font-size: 1.12rem; color: #3a4152; margin: 14px 0 28px; }
h2 + .lead { margin-top: 8px; }
.section h2 { font-size: 1.7rem; margin: 34px 0 10px; }
.section h2:first-child { margin-top: 0; }

.feature-list { list-style: none; display: grid; gap: 12px; margin: 8px 0 20px; }
.feature-list li { position: relative; padding-left: 34px; color: #3a4152; }
.feature-list li::before {
    content: '✓'; position: absolute; left: 0; top: 0;
    width: 22px; height: 22px; background: rgba(232,181,58,.16); color: var(--gold-2);
    border-radius: 6px; display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}

/* ---------- Page hero ---------- */
.page-hero {
    background: linear-gradient(var(--ink), var(--ink-2));
    color: #fff;
    padding: 70px 0 60px;
}
.page-hero h1 { color: #fff; font-size: clamp(1.9rem, 3.5vw, 2.8rem); }
.page-hero p { color: #b9c0d4; max-width: 720px; margin-top: 14px; font-size: 1.08rem; }
.link-back { display: inline-block; margin-bottom: 16px; color: var(--gold); }

/* ---------- Icon grid ---------- */
.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px 0 34px; }
.icon-item {
    background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 24px; display: flex; align-items: center; gap: 14px; font-weight: 600; color: var(--ink);
}
.icon-item span { font-size: 1.8rem; }
.center-cta { text-align: center; margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.center-cta.center { justify-content: center; }

/* ---------- News ---------- */
.news-section { padding: 80px 0; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; transition: transform .2s, box-shadow .2s;
}
.news-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.news-card-body { padding: 26px; }
.news-card time { font-size: .8rem; color: var(--gold-2); font-weight: 600; }
.news-card h3 { font-size: 1.15rem; margin: 10px 0; }
.news-card p { color: var(--muted); font-size: .93rem; margin-bottom: 14px; }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--ink), #241a05); color: #fff; padding: 60px 0; }
.cta-band-inner { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; font-size: 1.9rem; }
.cta-band p { color: #c3c9db; margin-top: 8px; max-width: 560px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; background: #fff; }
.data-table th {
    text-align: left; padding: 14px 18px; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px;
    color: var(--muted); background: var(--paper-2); border-bottom: 1px solid var(--line);
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: 0; }
.data-table code { background: var(--paper-2); padding: 3px 8px; border-radius: 6px; font-size: .88rem; }
.data-table.chart .pos { font-family: var(--display); font-weight: 800; color: var(--gold-2); font-size: 1.1rem; width: 40px; }

.tops-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.tops-block h2 { margin-bottom: 16px; }

/* ---------- Search ---------- */
.search-bar { display: flex; gap: 12px; margin-bottom: 26px; }
.search-bar input {
    flex: 1; padding: 14px 18px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 1rem; font-family: var(--sans);
}
.search-bar input:focus { outline: none; border-color: var(--gold); }

.isrc-sample { margin: 18px 0 8px; }
.isrc-sample code { font-size: 1.4rem; background: var(--ink); color: var(--gold); padding: 12px 22px; border-radius: 10px; letter-spacing: 2px; display: inline-block; }

/* ---------- Doc list ---------- */
.doc-list { list-style: none; display: grid; gap: 12px; }
.doc-list a {
    display: flex; align-items: center; gap: 14px; padding: 18px 22px;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 600; color: var(--ink);
    transition: border-color .2s, transform .2s;
}
.doc-list a:hover { border-color: var(--gold); transform: translateX(4px); }
.doc-ico { color: var(--gold-2); font-size: 1.2rem; }
.doc-list em { margin-left: auto; font-style: normal; font-size: .72rem; background: var(--paper-2); padding: 4px 10px; border-radius: 6px; color: var(--muted); }

/* ---------- Forms ---------- */
.contact-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; }
.contact-info h3 { font-size: 1.4rem; margin-bottom: 10px; }
.contact-list { list-style: none; margin-top: 18px; display: grid; gap: 12px; color: #3a4152; }
.contact-list a { color: var(--gold-2); }
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 7px; }
.form label span { font-weight: 600; font-size: .9rem; }
.form input, .form textarea {
    padding: 13px 16px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 1rem; font-family: var(--sans); resize: vertical;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--gold); }
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .95rem; }
.alert-success { background: #e7f7ec; color: #1c7a3e; border: 1px solid #b6e3c4; }
.alert-error { background: #fdecec; color: #b3261e; border: 1px solid #f4c2c0; }
.alert-error ul { margin-left: 18px; }

/* ---------- Article ---------- */
.article-date { color: var(--gold); font-weight: 600; display: block; margin-bottom: 8px; }
.article-body p { margin-bottom: 18px; color: #3a4152; }

/* ---------- Error ---------- */
.error-page { padding: 120px 0; }
.error-code { font-family: var(--display); font-size: 6rem; font-weight: 800; color: var(--gold); line-height: 1; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #aab2c6; padding: 60px 0 0; margin-top: 20px; }
.footer-inner {
    max-width: var(--container); margin: 0 auto; padding: 0 24px 40px;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px;
}
.footer-brand .brand-mark { color: #fff; }
.footer-logo { height: 40px; width: auto; margin-bottom: 4px; }
.footer-brand p { margin-top: 12px; font-size: .92rem; }
.footer-full { color: #6f7893 !important; font-size: .8rem !important; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 14px; }
.footer-col a, .footer-col span { display: block; color: #aab2c6; font-size: .9rem; padding: 4px 0; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.08); padding: 20px 24px; max-width: var(--container); margin: 0 auto;
    display: flex; justify-content: space-between; font-size: .82rem; color: #6f7893; flex-wrap: wrap; gap: 8px;
}
.footer-bottom a:hover { color: var(--gold); }

/* ---------- Auth ---------- */
.auth-wrap {
    min-height: 70vh;
    display: grid;
    place-items: center;
    background: radial-gradient(900px 400px at 50% -10%, rgba(232,181,58,.1), transparent 60%), var(--paper-2);
    padding: 60px 20px;
}
.auth-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px 34px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}
.auth-logo { height: 40px; width: auto; margin: 0 auto 18px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-sub { color: var(--muted); font-size: .92rem; margin: 8px 0 22px; }
.auth-card .form { text-align: left; }
.btn-block { width: 100%; justify-content: center; }
.auth-demo { margin-top: 20px; font-size: .8rem; color: var(--muted); background: var(--paper-2); padding: 10px; border-radius: 8px; }

/* ---------- Member area ---------- */
.member-page { padding: 50px 0 80px; background: var(--paper-2); min-height: 70vh; }
.member-grid { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; }
.member-side {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; position: sticky; top: 96px;
}
.member-id { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.member-avatar {
    width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #1a1400;
    display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.2rem;
}
.member-id strong { display: block; font-size: .95rem; color: var(--ink); }
.member-id small { color: var(--muted); font-size: .8rem; word-break: break-all; }
.member-nav { display: grid; gap: 4px; }
.member-nav a { padding: 11px 14px; border-radius: 9px; font-weight: 500; color: #3a4152; font-size: .93rem; transition: background .15s, color .15s; }
.member-nav a:hover { background: var(--paper-2); }
.member-nav a.active { background: var(--ink); color: #fff; }
.member-nav a.logout { color: var(--red); margin-top: 6px; }
.member-nav a.logout:hover { background: #fdecec; }

.member-main h1 { font-size: 1.8rem; margin-bottom: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
    display: flex; flex-direction: column; gap: 8px;
}
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.stat-value { font-family: var(--display); font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.stat-value.green { color: #1c7a3e; }
.stat-value.amber { color: var(--gold-2); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.panel-head h2 { font-size: 1.2rem; }
.pill-info { display: inline-block; margin: 12px 0 20px; font-size: .9rem; color: #3a4152; }
.pill-info code { background: var(--ink); color: var(--gold); padding: 4px 10px; border-radius: 6px; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-green { background: #e7f7ec; color: #1c7a3e; }
.badge-amber { background: #fdf3dc; color: var(--gold-2); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-visual { display: none; }
    .tops-grid, .contact-grid { grid-template-columns: 1fr; }
    .icon-grid { grid-template-columns: repeat(2, 1fr); }
    .member-grid { grid-template-columns: 1fr; }
    .member-side { position: static; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed; inset: 76px 0 auto 0; background: var(--ink);
        flex-direction: column; align-items: flex-start; gap: 0; padding: 12px 24px 24px;
        border-bottom: 1px solid rgba(255,255,255,.08);
        transform: translateY(-120%); transition: transform .3s ease; max-height: calc(100vh - 76px); overflow-y: auto;
    }
    .main-nav.open { transform: translateY(0); }
    .main-nav > a { width: 100%; padding: 13px 0; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
    .main-nav > a.active::after { display: none; }
    .nav-actions { width: 100%; justify-content: space-between; margin-top: 14px; }
    .nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
    .nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (max-width: 720px) {
    .cards, .news-grid { grid-template-columns: 1fr; }
    .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
    .brand-sub { display: none; }
    .header-inner { height: 68px; }
    .main-nav { inset: 68px 0 auto 0; }
}
