/* ============================================================
   Colombo Marathon 2026 — "Lace Up For a Cause"
   Main Stylesheet (v7)

   Design principle: ONE dominant brand color (blue) drives all
   interactive elements. Red/green/gold are reserved for meaning
   (error / success / highlight) rather than decoration, except
   for the event-distance cards where 4 distinct colors genuinely
   help tell the options apart at a glance.
============================================================ */

:root {
    --blue: #1077bc;
    --blue-dark: #0b5a8c;
    --blue-deep: #073d61;
    --blue-light: #eef6fc;
    --red: #b31e24;
    --red-tint: #fdeeef;
    --green: #00ab4f;
    --green-tint: #e8f8ee;
    --gold: #faa419;
    --gold-tint: #fef3e2;
    --ink: #16213d;
    --ink-soft: #5b6678;
    --ink-faint: #93a0b3;
    --line: #9db5db;
    --surface: #ffffff;
    --page-bg: #f3f7fb;
    --r-lg: 18px;
    --r-md: 12px;
    --r-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 33, 61, 0.04), 0 10px 28px -10px rgba(16, 33, 61, 0.12);
    --shadow-lg: 0 24px 64px -20px rgba(16, 33, 61, 0.22);
}

/* Section accents — used sparingly: event-distance cards, and the
   numbered step badge cycles through these for quick scanning on
   the long registration form. Everything else stays blue. */
.acc-blue  { --acc: #1077bc; --acc-tint: #eef6fc; }
.acc-red   { --acc: #b31e24; --acc-tint: #fdeeef; }
.acc-green { --acc: #00ab4f; --acc-tint: #e8f8ee; }
.acc-gold  { --acc: #d4880a; --acc-tint: #fef3e2; }

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', 'Segoe UI', Tahoma, Arial, sans-serif;
    background: var(--page-bg);
    color: var(--ink);
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: 'Poppins', 'Inter', sans-serif; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }
button { font-family: inherit; }

.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }
.main-content { flex: 1; display: flex; flex-direction: column;background: #1073b8; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
    background: var(--surface);
    height: 64px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid var(--line);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand .logo { max-width: 150px; max-height: 42px; width: auto; height: auto; flex-shrink: 0; }
.brand-text { line-height: 1.15; display: none; }
.brand-text .title { font-weight: 700; font-size: 12.5px; color: var(--ink); }
.brand-text .subtitle { font-size: 9px; color: var(--ink-faint); font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; }
@media (min-width: 640px) { .brand-text { display: block; } }

.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
    color: var(--ink-soft);
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
}
.nav-links a:hover { background: var(--blue-light); color: var(--blue-deep); }
.nav-links a.btn-nav-primary { background: var(--blue); color: var(--surface); font-weight: 700; }
.nav-links a.btn-nav-primary:hover { background: var(--blue-dark); }
.nav-toggle { display: none; background: none; border: none; color: var(--ink); font-size: 22px; cursor: pointer; }

/* ============================================================
   AUTH SHELL — centered single card (login / forgot password)
============================================================ */
.auth-shell {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
}
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    padding: 44px 40px;
}
.auth-logo { width: 116px; margin: 0 auto 22px; }
.auth-eyebrow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.auth-card h1 { font-size: 23px; font-weight: 700; color: var(--ink); text-align: center; margin: 0 0 6px; }
.auth-card .sub { text-align: center; color: var(--ink-soft); font-size: 13.5px; margin: 0 0 30px; }

/* ============================================================
   REGISTER HERO BANNER (top of registration page only)
============================================================ */
.reg-hero {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    text-align: center;
    padding: 38px 20px 34px;
}
.reg-hero .auth-logo { margin-bottom: 16px; }
.reg-hero h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--ink);
    margin: 0 0 6px;
    letter-spacing: 0.2px;
}
.reg-hero .tagline {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--gold-dark, #c98a12);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin: 0 0 10px;
}
.reg-hero .org {
    font-size: 11.5px;
    color: var(--ink-faint);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    font-weight: 600;
}

.reg-shell { flex: 1; display: flex; justify-content: center; padding: 36px 20px 56px; }
.reg-card {
    width: 100%;
    max-width: 760px;
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
    padding: 40px 44px;
}

.form-head { margin-bottom: 8px; }
.form-head h1 { font-size: 21px; font-weight: 700; color: var(--ink); margin: 0 0 5px; }
.form-head p { color: var(--ink-soft); font-size: 13px; margin: 0 0 26px; }

/* ============================================================
   FORM SECTIONS
============================================================ */
.form-section { padding-bottom: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.form-section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-step {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--acc, var(--blue));
    color: var(--surface);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 12.5px;
    font-family: 'Poppins', sans-serif;
}
.form-section-header h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 0; }
.form-section-header p { font-size: 12px; color: var(--ink-soft); margin: 1px 0 0; }
.section-icon {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: var(--blue-light);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ============================================================
   FIELDS — neutral resting state, blue only on focus
============================================================ */
.field-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 20px; }
.field-grid .full-width { grid-column: 1 / -1; }
.doc-block.jq-hidden { display: none; }

.field { margin-bottom: 2px; }
.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 7px;
}
.field label .req { color: var(--red); }

.input-wrap { position: relative; }
.input-icon {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    display: flex;
    pointer-events: none;
    transition: color 0.15s;
}
.input-wrap:focus-within .input-icon { color: var(--blue); }

.field-input {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 500;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input.has-icon { padding-left: 41px; }
.field-input.has-right-icon { padding-right: 42px; }
.field-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3.5px rgba(16, 119, 188, 0.14);
}
.field-input::placeholder { color: var(--ink-faint); }
select.field-input { appearance: none; cursor: pointer; padding-right: 38px; }
.select-chevron {
    position: absolute;
    right: 13px; top: 50%;
    transform: translateY(-50%);
    color: var(--ink-faint);
    pointer-events: none;
}
textarea.field-input { resize: vertical; min-height: 80px; }

/* ---- Validation error messages (jQuery-driven) ---- */
.field-error {
    color: var(--red);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: none;
    align-items: center;
    gap: 5px;
}
.field-error.show { display: flex; }
.field.is-invalid .field-input,
.field-input.is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3.5px rgba(179, 30, 36, 0.1) !important; }
@keyframes shake-field {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}
.shake { animation: shake-field 0.4s ease; }

.password-toggle {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--ink-faint);
    cursor: pointer;
    display: flex;
    padding: 2px;
}
.password-toggle:hover { color: var(--blue); }

/* ============================================================
   CHOICE GROUPS (gender / event radio cards)
============================================================ */
.choice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.choice-pill { position: relative; }
.choice-pill input { position: absolute; opacity: 0; pointer-events: none; }
.choice-pill label {
    display: inline-flex;
    align-items: center;
    padding: 10px 26px;
    border-radius: 30px;
    border: 1.5px solid var(--line);
    background: var(--surface);
    font-weight: 600;
    font-size: 13.5px;
    color: var(--ink-soft);
    cursor: pointer;
    transition: all 0.15s;
}
.choice-pill label:hover { border-color: var(--blue); color: var(--blue); }
.choice-pill input:checked + label { background: var(--blue); border-color: var(--blue); color: var(--surface); }

.event-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.event-card { position: relative; }
.event-card input { position: absolute; opacity: 0; pointer-events: none; }
.event-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    text-align: center;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 16px 8px 14px;
    cursor: pointer;
    transition: all 0.15s;
}
.event-card label:hover { border-color: var(--acc); }
.event-card .ev-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--acc-tint);
    color: var(--acc);
    display: flex; align-items: center; justify-content: center;
}
.event-card .ev-letter { font-size: 9.5px; font-weight: 700; color: var(--ink-faint); letter-spacing: 0.5px; }
.event-card .ev-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.event-card .ev-dist { font-size: 10.5px; color: var(--ink-soft); }
.event-card input:checked + label { border-color: var(--acc); background: var(--acc-tint); }
.event-card input:checked + label .ev-icon { background: var(--acc); color: var(--surface); }

/* ============================================================
   FILE UPLOAD (dropzone)
============================================================ */
.dropzone {
    display: flex;
    align-items: center;
    gap: 13px;
    border: 1.5px dashed var(--line);
    border-radius: var(--r-md);
    background: #fafbfd;
    padding: 15px 17px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--blue); background: var(--blue-light); }
.dropzone .dz-icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: var(--surface);
    color: var(--blue);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.dropzone .dz-text { font-size: 13px; color: var(--ink); font-weight: 600; }
.dropzone .dz-hint { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: var(--green-tint); }
.dropzone.has-file .dz-icon { background: var(--green); color: var(--surface); }
.dropzone.has-file .dz-text { color: #00863d; }

.file-existing {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--green-tint);
    border: 1.5px solid var(--green);
    border-radius: var(--r-md);
    padding: 13px 16px;
}
.file-existing .fe-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--green);
    color: var(--surface);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.file-existing .fe-text { font-size: 13px; font-weight: 700; color: #00863d; }
.file-existing .fe-sub { font-size: 11px; color: #1f7d4c; margin-top: 1px; }
.file-existing .tag {
    margin-left: auto;
    background: var(--green);
    color: var(--surface);
    font-size: 10px;
    padding: 4px 11px;
    border-radius: 20px;
    font-weight: 700;
    flex-shrink: 0;
}

/* ============================================================
   HUMAN VERIFICATION — clean equation, restrained color
============================================================ */
.math-captcha { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mc-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-light);
    border: 1.5px solid #cfe5f4;
    border-radius: var(--r-sm);
    padding: 12px 20px;
    font-family: 'Poppins', sans-serif;
    font-size: 21px;
    font-weight: 700;
    color: var(--blue-deep);
}
.mc-box .op { color: var(--blue); }
.mc-box .eq { color: var(--ink-faint); font-size: 17px; }
.math-captcha .field-input { max-width: 140px; flex: 1; min-width: 110px; font-weight: 700; text-align: center; }

/* ============================================================
   AGREEMENT CHECKBOX
============================================================ */
.agree-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #fafbfd;
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    padding: 16px 18px;
    margin: 26px 0;
}
.agree-box input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--blue); flex-shrink: 0; cursor: pointer; }
.agree-box label { font-size: 12.5px; color: var(--ink-soft); line-height: 1.55; cursor: pointer; }
.agree-box .field-error { margin-top: 8px; }

/* ============================================================
   BUTTONS — one consistent primary style
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 26px;
    border-radius: var(--r-sm);
    font-size: 14.5px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
    font-family: inherit;
}
.btn-primary {
    background: var(--blue);
    color: var(--surface);
    box-shadow: 0 6px 16px -4px rgba(16, 119, 188, 0.45);
}
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 8px 20px -4px rgba(16, 119, 188, 0.55); }
.btn-secondary { background: var(--ink); color: var(--surface); }
.btn-block { width: 100%; }
.btn-outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink-soft); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ============================================================
   ALERTS
============================================================ */
.alert { padding: 12px 15px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 20px; font-weight: 500; display: flex; align-items: flex-start; gap: 10px; }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--green-tint); color: #00863d; border: 1px solid #aee4c4; }
.alert-danger { background: var(--red-tint); color: var(--red); border: 1px solid #f3c2c5; }
.alert ul { margin: 4px 0 0 0; padding-left: 18px; list-style: disc; }

.helper-links { text-align: center; margin-top: 22px; font-size: 13px; color: var(--ink-soft); }
.helper-links a { color: var(--blue); font-weight: 600; }
.helper-links a:hover { color: var(--blue-dark); }

/* ============================================================
   SUCCESS PANEL
============================================================ */
.success-panel { text-align: center; padding: 10px 0; }
.success-panel .sp-icon {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: var(--green-tint);
    color: var(--green);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 16px;
}
.success-panel h2 { color: #00863d; font-size: 20px; margin: 0 0 6px; }
.success-panel .reg-no { font-size: 22px; font-weight: 800; color: var(--blue-deep); letter-spacing: 1px; margin: 14px 0; font-family: 'Poppins', sans-serif; }
.success-panel p { color: var(--ink-soft); font-size: 13px; margin: 0 0 6px; }

/* ============================================================
   PROFILE DASHBOARD
============================================================ */
.dashboard-shell {
    flex: 1;
    max-width: 1180px;
    margin: 0 auto;
    width: 100%;
    padding: 32px 20px 60px;
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 22px;
    align-items: start;
}
.profile-card {
    background: var(--surface);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 26px 22px;
    text-align: center;
    border: 1px solid var(--line);
    position: sticky;
    top: 80px;
}
.profile-avatar {
    width: 70px; height: 70px;
    border-radius: 50%;
    background: var(--blue);
    color: var(--surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700;
    margin: 0 auto 14px;
    font-family: 'Poppins', sans-serif;
}
.profile-card h2 { font-size: 16px; margin: 0 0 3px; color: var(--ink); }
.profile-card .role { font-size: 12px; color: var(--ink-soft); margin: 0 0 14px; }
.reg-badge { display: inline-block; background: var(--blue-light); color: var(--blue-deep); padding: 5px 13px; border-radius: 20px; font-size: 11.5px; font-weight: 700; margin-bottom: 16px; }
.profile-meta { text-align: left; border-top: 1px solid var(--line); padding-top: 15px; margin-top: 2px; }
.profile-meta-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 12px; color: var(--ink-soft); }
.profile-meta-row svg { color: var(--blue); flex-shrink: 0; }
.profile-meta-row strong { color: var(--ink); font-weight: 600; }

.profile-main { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 30px 32px; border: 1px solid var(--line); }
.profile-main .form-head { margin-bottom: 4px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.profile-main .form-head p { margin-bottom: 0; }

.disabled-note { font-size: 11px; color: var(--ink-faint); margin-top: 6px; }
.field-input[readonly], .field-input:disabled { background: #f4f5f7; color: var(--ink-faint); cursor: not-allowed; }
.input-wrap:has(.field-input:disabled) .input-icon,
.input-wrap:has(.field-input[readonly]) .input-icon { color: #c3c9d3; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 900px) {
    .field-grid { grid-template-columns: 1fr; }
    .event-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-shell { grid-template-columns: 1fr; }
    .profile-card { position: relative; top: 0; }
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: var(--surface);
        flex-direction: column;
        align-items: stretch;
        padding: 8px 14px 16px;
        gap: 2px;
        display: none;
        box-shadow: 0 10px 24px rgba(16,33,61,0.10);
        border-bottom: 1px solid var(--line);
    }
    .nav-links.open { display: flex; }
    .nav-links a { text-align: center; padding: 11px; }
    .nav-toggle { display: block; }
    .auth-card { padding: 34px 24px; }
    .reg-card { padding: 28px 20px; }
    .profile-main { padding: 24px 18px; }
}

@media (max-width: 480px) {
    .event-grid { grid-template-columns: repeat(2, 1fr); }
    .math-captcha .field-input { max-width: 100%; }
    .form-head h1 { font-size: 19px; }
    .reg-hero h1 { font-size: 22px; }
    .choice-row { gap: 6px; }
    .choice-pill label { padding: 9px 18px; font-size: 13px; }
    .mc-box { font-size: 17px; padding: 10px 14px; }
}
