/* ====================================================================
   NGJCI Membership Portal — public styles
   ==================================================================== */
:root {
    --navy: #0f2a4a;
    --navy-light: #1c3d63;
    --gold: #c9a227;
    --gold-dark: #a8861a;
    --bg: #f4f6f9;
    --card: #ffffff;
    --line: #dde3ea;
    --text: #1f2a37;
    --muted: #66707d;
    --green: #1f9d55;
    --red: #d64545;
    --amber: #c77700;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(16, 32, 56, 0.08), 0 1px 2px rgba(16, 32, 56, 0.06);
}

* { box-sizing: border-box; }

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

.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
    border-bottom: 3px solid var(--gold);
}
.header-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; padding: 16px 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
    background: var(--gold); color: var(--navy); font-weight: 800;
    width: 54px; height: 54px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; letter-spacing: .5px; flex-shrink: 0;
}
.brand-hi { font-size: 13px; opacity: .9; }
.brand-en { font-size: 17px; font-weight: 700; }
.brand-sub { font-size: 11px; opacity: .75; }
.header-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.header-nav a {
    color: #fff; text-decoration: none; font-size: 14px; font-weight: 500;
    padding: 8px 14px; border-radius: 6px; transition: background .15s;
}
.header-nav a:hover { background: rgba(255,255,255,.12); }

/* ---- Page ---- */
.page { padding: 28px 20px 48px; }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--navy); }
h2 { font-size: 18px; margin: 0; }
.lead { color: var(--muted); margin: 0 0 24px; }

/* ---- Cards / fieldsets ---- */
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 32, 56, .05), 0 6px 16px rgba(16, 32, 56, .04);
    padding: 26px 28px; margin-bottom: 20px;
}
fieldset.section {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--card); box-shadow: var(--shadow);
    padding: 0 22px 22px; margin: 0 0 20px;
}
fieldset.section > legend {
    font-weight: 700; color: var(--navy); font-size: 16px;
    padding: 6px 12px; margin-left: -6px;
    background: #eef3f9; border: 1px solid var(--line); border-radius: 6px;
}
.section-hint { color: var(--muted); font-size: 13px; margin: 14px 0 4px; }

/* ---- Form grid ---- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field.col-span-2 { grid-column: 1 / -1; }
label { font-size: 13px; font-weight: 600; color: #33404f; }
label .req { color: var(--red); }
.hint { font-size: 12px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="password"], select, textarea {
    font: inherit; color: var(--text);
    padding: 9px 11px; border: 1px solid #c6cdd6; border-radius: 6px;
    background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(28, 61, 99, .12);
}
textarea { resize: vertical; min-height: 64px; }
input[type="file"] { font-size: 13px; }

/* ---- Choice groups ---- */
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
.choice {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px; border: 1px solid #c6cdd6; border-radius: 6px;
    cursor: pointer; font-size: 14px; background: #fff;
}
.choice:hover { border-color: var(--navy-light); }
.choice input { accent-color: var(--navy); }
.choice.block { width: 100%; }

.category-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.category-card {
    border: 1px solid #c6cdd6; border-radius: 8px; padding: 14px; cursor: pointer;
    display: flex; gap: 10px; align-items: flex-start; background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.category-card:hover { border-color: var(--navy-light); }
.category-card input { margin-top: 3px; accent-color: var(--navy); }
.category-card.selected { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(15,42,74,.12); }
.category-card .cc-title { font-weight: 700; color: var(--navy); }
.category-card .cc-desc { font-size: 12px; color: var(--muted); }

/* ---- Conditional blocks ---- */
.conditional { display: none; }
.conditional.active { display: block; }

/* ---- Fee box ---- */
.fee-box {
    margin-top: 18px; padding: 16px 18px; border-radius: 8px;
    background: #fbf6e6; border: 1px solid #e7d79a;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.fee-box .fee-label { font-size: 13px; color: var(--gold-dark); font-weight: 600; }
.fee-box .fee-amount { font-size: 26px; font-weight: 800; color: var(--navy); }
.fee-box small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---- Condensed fee summary (always visible on the form) ---- */
.fee-summary { margin-top: 18px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; }
.fee-summary .fs-title { margin: 0 0 12px; color: var(--navy); font-size: 15px; font-weight: 700; }
.fee-summary .fs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fee-summary .fs-wide { grid-column: 1 / -1; }
.fee-summary .fs-head { display: block; font-weight: 700; color: #33404f; font-size: 13px; margin-bottom: 6px; }
.fee-summary table.mini { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.fee-summary table.mini th, .fee-summary table.mini td { border: 1px solid var(--line); padding: 5px 9px; text-align: left; }
.fee-summary table.mini thead th { background: #eef3f9; color: #33404f; font-weight: 600; }
.fee-summary table.mini td.num, .fee-summary table.mini th.num { text-align: right; white-space: nowrap; }
.fee-summary .fs-cap { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.fee-summary .fs-link { margin: 12px 0 0; font-size: 12.5px; }
@media (max-width: 760px) { .fee-summary .fs-grid { grid-template-columns: 1fr; } }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.data thead th { background: var(--navy); color: #fff; font-weight: 600; }
table.data tbody tr:nth-child(even) { background: #f7f9fc; }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; cursor: pointer;
    padding: 11px 22px; border-radius: 6px; border: 1px solid transparent;
    text-decoration: none; transition: background .15s, opacity .15s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-ghost { background: #fff; color: var(--navy); border-color: #c6cdd6; }
.btn-ghost:hover { border-color: var(--navy); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

.form-actions { margin-top: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; border: 1px solid; }
.alert-success { background: #e8f6ee; border-color: #b6e2c6; color: #176b3a; }
.alert-error   { background: #fdeaea; border-color: #f3c2c2; color: #9b2c2c; }
.alert-info    { background: #e9f0fa; border-color: #c2d6f3; color: #1c3d63; }
.error-list { margin: 8px 0 0; padding-left: 20px; }
.error-list li { font-size: 13px; }

.field-error { border-color: var(--red) !important; }
.field .msg { font-size: 12px; color: var(--red); }

/* ---- Declaration ---- */
.declaration {
    background: #f7f9fc; border: 1px solid var(--line);
    border-radius: 6px; padding: 14px 16px; font-size: 13px; color: #3a4655;
    margin-top: 16px;
}

/* ---- Reference / status ---- */
.ref-hero {
    text-align: center; padding: 36px 22px; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.ref-hero .check {
    width: 64px; height: 64px; border-radius: 50%; background: #e8f6ee;
    color: var(--green); font-size: 34px; line-height: 64px; margin: 0 auto 14px;
}
.ref-code {
    display: inline-block; font-size: 26px; font-weight: 800; letter-spacing: 1px;
    color: var(--navy); background: #fbf6e6; border: 1px dashed var(--gold);
    padding: 10px 22px; border-radius: 8px; margin: 12px 0;
}

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-submitted    { background: #e9f0fa; color: #1c3d63; }
.badge-under_review { background: #fff3df; color: #9a5b00; }
.badge-approved     { background: #e8f6ee; color: #176b3a; }
.badge-rejected     { background: #fdeaea; color: #9b2c2c; }
.badge-on_hold      { background: #eee9f7; color: #5b3d8a; }

/* ---- Misc ---- */
.note { font-size: 12px; color: var(--muted); }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }
.bank-box { font-size: 13px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
    .grid, .grid-3, .category-cards { grid-template-columns: 1fr; }
    .brand-en { font-size: 15px; }
    .fee-box { flex-direction: column; align-items: flex-start; }
}

/* ====================================================================
   FORM REDESIGN — hero, sticky section nav, refined cards & spacing
   ==================================================================== */
html { scroll-behavior: smooth; }

/* Hero header */
.form-hero, .page-hero {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff; border-radius: 14px; padding: 26px 30px; margin-bottom: 24px;
    box-shadow: 0 8px 22px rgba(15, 42, 74, .20);
}
.form-hero h1, .page-hero h1 { color: #fff; margin: 0 0 6px; font-size: 26px; }
.form-hero .lead, .page-hero .lead { color: rgba(255, 255, 255, .82); margin: 0; }

/* Two-column shell: sticky rail + form body */
.form-shell { display: grid; grid-template-columns: 212px 1fr; gap: 28px; align-items: start; }
.form-rail { position: sticky; top: 18px; align-self: start; }
.rail-inner { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px; }
.rail-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 8px 10px; font-weight: 700; }
.rail-nav { list-style: none; margin: 0; padding: 0; }
.rail-nav a {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    color: #455364; font-size: 13px; font-weight: 500;
    padding: 8px 10px; border-radius: 8px; transition: background .15s, color .15s;
}
.rail-nav a .rail-no {
    width: 22px; height: 22px; border-radius: 50%; background: #eef2f7; color: #5a6678;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
    flex-shrink: 0; transition: background .15s, color .15s;
}
.rail-nav a:hover { background: #f2f6fb; color: var(--navy); }
.rail-nav a.active { background: #eaf1fb; color: var(--navy); font-weight: 700; }
.rail-nav a.active .rail-no { background: var(--navy); color: #fff; }
.form-main { min-width: 0; }

/* Section cards */
fieldset.section {
    border: 1px solid var(--line); border-radius: 14px; background: var(--card);
    box-shadow: 0 1px 2px rgba(16, 32, 56, .05), 0 6px 16px rgba(16, 32, 56, .04);
    padding: 32px 28px 26px; margin: 0 0 22px; position: relative; scroll-margin-top: 16px;
}
fieldset.section > legend {
    display: inline-flex; align-items: center; gap: 11px;
    font-size: 16px; font-weight: 700; color: var(--navy);
    padding: 7px 18px 7px 7px; margin-left: -2px;
    background: #fff; border: 1px solid var(--line); border-radius: 999px;
    box-shadow: 0 2px 6px rgba(16, 32, 56, .07);
}
.sec-no {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800; box-shadow: 0 2px 5px rgba(15, 42, 74, .30);
}

/* Inputs & fields refinement */
.field { gap: 7px; margin-top: 18px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="number"], input[type="date"], input[type="password"], select, textarea {
    padding: 10px 13px; border: 1px solid #cdd5df; border-radius: 9px;
    transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #aeb9c7; }
.grid { gap: 18px 22px; }

/* Choice chips */
.choice { padding: 9px 14px; border-radius: 8px; transition: border-color .15s, background .15s; }
.choice:hover { background: #f6f9fd; }

/* Category cards */
.category-cards { gap: 14px; }
.category-card { padding: 16px 18px; border-radius: 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
.category-card:hover { background: #f8fbff; }
.category-card.selected { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15, 42, 74, .12); background: #f4f8ff; }

/* Bottom action bar — scoped to the membership form only */
#membership-form .form-actions {
    margin-top: 8px; padding: 20px 24px; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; box-shadow: var(--shadow);
    display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}

/* Redesign responsive */
@media (max-width: 920px) {
    .form-shell { grid-template-columns: 1fr; }
    .form-rail { display: none; }
}
@media (max-width: 760px) {
    .form-hero { padding: 20px; }
    .form-hero h1 { font-size: 22px; }
    fieldset.section { padding: 30px 18px 22px; }
}
