/* ScholarHub - main stylesheet */
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e3e8f0;
    --primary: #2f5bea;
    --primary-dark: #2145c4;
    --navy: #0b1b3b;
    --accent: #f59e0b;
    --accent-dark: #d98a06;
    --green: #16a34a;
    --red: #dc2626;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
    --shadow-hover: 0 2px 4px rgba(15, 23, 42, .08), 0 16px 36px rgba(47, 91, 234, .16);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}
img, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h2.h2 { font-size: 1.5rem; margin: 0; }
h2.h3, h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code { background: #eef2ff; padding: .1em .4em; border-radius: 5px; font-size: .9em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.section { padding: 40px 20px; }
.narrow { max-width: 560px; }
.narrow-wide { max-width: 820px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.2rem; color: var(--navy); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.4rem; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a, .nav-btn { color: var(--text); padding: 8px 12px; border-radius: 9px; font-weight: 500; font-size: .95rem; }
.site-nav a:hover, .nav-btn:hover { background: var(--bg); text-decoration: none; }
.site-nav a.active { color: var(--primary); }
.site-nav a.btn { color: #fff; }
.nav-btn { background: none; border: 0; cursor: pointer; font-family: inherit; }
.inline-form { display: inline; margin: 0; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 4px 0; border-radius: 2px; transition: .2s; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; font-family: inherit; font-weight: 600; font-size: 1rem; padding: 11px 20px; border-radius: 11px; border: 1px solid transparent; cursor: pointer; text-align: center; transition: transform .12s, background .15s, box-shadow .15s; line-height: 1.3; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:disabled { opacity: .65; cursor: wait; transform: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #1a1100; box-shadow: 0 6px 18px rgba(245, 158, 11, .35); }
.btn-accent:hover { background: var(--accent-dark); color: #1a1100; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: #c5cede; }
.btn-danger { background: #fff; color: var(--red); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 7px 14px; font-size: .9rem; border-radius: 9px; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; }

/* ---------- Flash ---------- */
.flash-wrap:empty { display: none; }
.flash-wrap { padding-top: 16px; }
.flash { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 11px; margin-bottom: 12px; font-size: .95rem; border: 1px solid; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.flash-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.form-card .flash { margin: 0 0 14px; }

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% -10%, rgba(99, 140, 255, .45), transparent 60%), linear-gradient(135deg, #0b1b3b 0%, #17306b 55%, #2347c4 100%); color: #fff; padding: 64px 0 56px; text-align: center; }
.hero h1 { margin-bottom: 14px; }
.hero-sub { max-width: 620px; margin: 0 auto 28px; font-size: 1.15rem; color: #cfd9f5; }
.hero-note { margin: 18px 0 0; color: #cfd9f5; font-size: .95rem; }
.hero-note a { color: #ffd37a; font-weight: 600; }
.search-bar { display: flex; gap: 10px; max-width: 680px; margin: 0 auto; background: #fff; padding: 8px; border-radius: 16px; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.search-bar input, .search-bar select { border: 0; font-family: inherit; font-size: 1rem; padding: 12px 14px; border-radius: 10px; background: #f3f5fa; color: var(--text); outline: none; }
.search-bar input { flex: 1; min-width: 0; }
.search-bar select { max-width: 200px; cursor: pointer; }
.search-bar input:focus, .search-bar select:focus { box-shadow: 0 0 0 3px rgba(47, 91, 234, .35); }

/* ---------- Continent filter + paging ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 26px; }
.pill { font-family: inherit; font-size: .95rem; font-weight: 600; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .12s; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.pill:hover { border-color: #b7c6f5; transform: translateY(-1px); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(47, 91, 234, .3); }
.pill-n { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); font-size: .78rem; }
.pill.active .pill-n { background: rgba(255, 255, 255, .22); color: #fff; }
.more-wrap { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
@media (max-width: 720px) {
    .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
    .filter-bar::-webkit-scrollbar { display: none; }
    .pill { white-space: nowrap; flex: none; }
}

/* ---------- Cards grid ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.list-head h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; color: var(--text); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; animation: pop .3s ease both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: #c7d4fb; }
.card h3 { font-size: 1.15rem; margin: 12px 0 6px; }
.card-meta { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.card-foot { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .92rem; color: var(--primary); padding-top: 14px; border-top: 1px dashed var(--border); }
.chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: .82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.chip-country { background: #eaf0ff; color: var(--primary-dark); }
.chip-light { background: rgba(255,255,255,.16); color: #fff; }
.empty { text-align: center; padding: 40px 0; color: var(--muted); }

.cta-band { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: linear-gradient(135deg, #0b1b3b, #2347c4); color: #fff; padding: 28px 32px; border-radius: 20px; }
.cta-band h2 { margin: 0 0 4px; }
.cta-band p { margin: 0; color: #cfd9f5; }

/* ---------- Membership ---------- */
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent-dark); margin-bottom: 10px; }
.pricing-wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: start; }
.notice { background: #fff8e6; border: 1px solid #fde4a3; padding: 12px 16px; border-radius: 11px; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; }
.checks li { position: relative; padding: 8px 0 8px 34px; }
.checks li::before { content: ""; position: absolute; left: 0; top: 11px; width: 22px; height: 22px; border-radius: 50%; background: #dcfce7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow-hover); position: sticky; top: 90px; }
.price { font-size: 3.6rem; font-weight: 800; letter-spacing: -.03em; text-align: center; line-height: 1; }
.price-sub { text-align: center; color: var(--muted); margin: 8px 0 24px; }
.price-card .btn-block { margin-bottom: 14px; }
.secure { display: flex; gap: 6px; align-items: flex-start; justify-content: center; margin: 10px 0 0; }
.success-text { color: var(--green); text-align: center; }

.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: 0; font-family: inherit; font-size: 1.05rem; font-weight: 600; padding: 18px 36px 18px 0; cursor: pointer; position: relative; color: var(--text); }
.faq-q::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--muted); transition: transform .2s; }
.faq-q[aria-expanded="true"]::after { transform: translateY(-50%) rotate(45deg); }
.faq-a { display: none; color: var(--muted); }
.faq-a p { margin: 0 0 18px; }

/* ---------- Detail page ---------- */
.detail-head { background: linear-gradient(135deg, #0b1b3b 0%, #17306b 60%, #2347c4 100%); color: #fff; padding: 36px 0 44px; }
.detail-head .back { display: inline-block; color: #cfd9f5; margin-bottom: 18px; font-size: .95rem; }
.detail-head .chip { display: inline-flex; margin: 0 0 12px; }
.detail-head h1 { margin-bottom: 10px; }
.detail-head .lead { color: #cfd9f5; max-width: 760px; margin: 0; }
.detail-layout { display: grid; grid-template-columns: 1fr 320px; gap: 28px; padding-top: 32px; padding-bottom: 56px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; gap: 12px; font-size: 1.25rem; margin-bottom: 14px; }
.panel .num { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: #eaf0ff; color: var(--primary-dark); font-size: .95rem; font-weight: 700; flex: none; }
.panel-accent { border-color: #c7d4fb; background: linear-gradient(180deg, #f7f9ff, #fff); }
.bullets { padding-left: 20px; margin: 0 0 4px; }
.bullets li { margin-bottom: 6px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 20px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 16px 46px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; display: flex; align-items: center; justify-content: center; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px; width: 2px; background: #dbe4fb; }
.sticky { position: sticky; top: 90px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 16px; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; font-weight: 600; }
.deadline { color: var(--red); }

/* ---------- Forms ---------- */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); }
.form-card.wide { max-width: 100%; }
.form-card h1 { font-size: 1.7rem; }
.field { display: block; margin-bottom: 16px; }
.field > span:first-child { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; font-family: inherit; font-size: 1rem; padding: 12px 14px; border: 1px solid #cfd8e6; border-radius: 10px; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 91, 234, .18); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 70px; }
.toggle-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--primary); font-weight: 600; font-size: .85rem; cursor: pointer; padding: 6px 8px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Misc ---------- */
.big-icon { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; font-size: 2.6rem; font-weight: 700; }
.big-icon.ok { background: #dcfce7; color: var(--green); }
.big-icon.wait { background: #fef3c7; color: var(--accent-dark); }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 999px; background: #eef1f6; color: var(--muted); vertical-align: middle; }
.badge-gold { background: #fff1cc; color: #8a5a00; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfe; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { white-space: nowrap; text-align: right; }
.form-card .table { margin-top: 8px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 28px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; color: var(--muted); font-size: .9rem; box-shadow: var(--shadow); }
.stat span { display: block; font-size: 1.8rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #cfd9f5; padding: 36px 0 20px; margin-top: 40px; }
.site-footer strong { color: #fff; font-size: 1.1rem; }
.site-footer .muted { color: #8fa0c8; max-width: 460px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: #cfd9f5; }
.copy { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .pricing-wrap, .detail-layout { grid-template-columns: 1fr; }
    .price-card, .sticky { position: static; }
    .detail-side { order: -1; }
}
@media (max-width: 720px) {
    .nav-toggle { display: block; }
    .site-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: #fff; border-bottom: 1px solid var(--border); padding: 12px 20px 18px; gap: 4px; box-shadow: 0 16px 24px rgba(15, 23, 42, .08); }
    .site-nav.open { display: flex; }
    .site-nav a, .nav-btn { padding: 12px; text-align: left; width: 100%; }
    .site-nav a.btn { text-align: center; }
    .inline-form { display: block; }
    .hero { padding: 44px 0 40px; }
    .search-bar { flex-direction: column; }
    .search-bar select { max-width: none; }
    .row { grid-template-columns: 1fr; }
    .form-card { padding: 24px 20px; }
    .cta-band { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
    .card { animation: none; }
}
