:root {
    --bg:           #f0f4f8;
    --surface:      #ffffff;
    --ink:          #111827;
    --ink2:         #374151;
    --muted:        #9ca3af;
    --border:       #e5e7eb;
    --blue:         #1d4ed8;
    --blue-mid:     #2563eb;
    --blue-light:   #dbeafe;
    --green:        #16a34a;
    --green-light:  #dcfce7;
    --orange:       #ea580c;
    --orange-light: #fff7ed;
    --red:          #b91c1c;
    --red-light:    #fee2e2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Barlow', sans-serif; min-height: 100vh; }

/* NAV */
.topnav {
    background: var(--surface);
    border-bottom: 2px solid var(--blue);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.topnav-inner {
    max-width: 1100px; margin: 0 auto; padding: 0 24px;
    height: 60px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-badge {
    background: var(--blue);
    color: white;
    width: 38px; height: 38px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.logo-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: 21px;
    letter-spacing: 0.02em;
    color: var(--ink);
    line-height: 1;
}
.logo-name span { color: var(--blue); }
.nav-tag {
    font-size: 11px; letter-spacing: 0.06em;
    color: var(--muted); text-transform: uppercase;
}
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-back {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--muted);
    text-decoration: none; transition: color .15s;
}
.nav-back:hover { color: var(--blue); }
.btn-logout {
    font-size: 12px; color: var(--muted);
    background: none; border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 6px;
    cursor: pointer; font-family: 'Barlow', sans-serif;
    transition: all .15s; display: flex; align-items: center; gap: 5px;
}
.btn-logout:hover { color: var(--red); border-color: #fca5a5; background: var(--red-light); }

/* HERO */
.hero {
    background: var(--blue);
    padding: 52px 24px 56px;
    position: relative; overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute; right: 0; top: 0; bottom: 0; width: 45%;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px, transparent 44px,
        rgba(255,255,255,0.05) 44px, rgba(255,255,255,0.05) 48px
    );
    transform: skewX(-6deg) translateX(20px);
    pointer-events: none;
}
.hero-inner { max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.hero-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: white;
    padding: 5px 14px; border-radius: 100px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
    margin-bottom: 18px;
}
.hero-pill-dot {
    width: 6px; height: 6px; border-radius: 50%; background: #4ade80;
    animation: pulse-g 2s ease infinite;
}
@keyframes pulse-g { 0%,100%{opacity:1;} 50%{opacity:0.35;} }
.hero-h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900; font-style: italic;
    font-size: clamp(42px, 7.5vw, 76px);
    line-height: 0.93; letter-spacing: 0.01em;
    color: white; margin-bottom: 16px;
}
.hero-h1 .dim { color: rgba(255,255,255,0.5); font-style: normal; }
.hero-sub { font-size: 15px; color: rgba(255,255,255,0.65); max-width: 380px; line-height: 1.6; }
.hero-finish {
    position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background: repeating-linear-gradient(90deg, white 0,white 18px, transparent 18px, transparent 34px);
    opacity: 0.12;
}

/* SECTION HEADER */
.sec-head {
    max-width: 1100px; margin: 0 auto;
    padding: 24px 24px 0;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.sec-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 24px; color: var(--ink);
}
.count-chip {
    font-size: 12px; color: var(--blue);
    background: var(--blue-light);
    border: 1px solid rgba(29,78,216,0.15);
    padding: 4px 12px; border-radius: 100px;
    font-weight: 600;
}

/* MAIN */
main { max-width: 1100px; margin: 0 auto; padding: 16px 24px 80px; }

/* CARD */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    overflow: hidden;
}
.ecard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .22s ease, transform .22s ease;
    animation: up .4s ease both;
    display: flex;
}
.ecard:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.09); transform: translateY(-2px); }
@keyframes up { from{opacity:0;transform:translateY(16px);} to{opacity:1;transform:translateY(0);} }
.ecard-main-content {
    flex: 1;
    min-width: 0;
    display: flex;
}
.ecard-bar { width: 5px; background: var(--blue); flex-shrink: 0; }
.ecard-inner { display: flex; align-items: stretch; flex: 1; }
.ecard-content { flex: 1; padding: 20px 22px 20px 26px; min-width: 0; }
.ecard-side {
    width: 160px; flex-shrink: 0;
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 20px 16px; gap: 12px;
    background: #fafbfc;
}

.card-header {
    background: var(--blue);
    padding: 28px 32px;
    color: white;
    position: relative;
    overflow: hidden;
}
.card-header::after {
    content: '🏃';
    position: absolute; right: 24px; top: 50%;
    transform: translateY(-50%);
    font-size: 64px; opacity: 0.15;
}
.card-header-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255,255,255,0.6); margin-bottom: 6px;
}
.card-header-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900; font-size: 28px; letter-spacing: 0.01em;
    color: white; line-height: 1.1;
}
.card-body { padding: 28px 32px; }

/* Row 1 */
.ecard-row1 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.sport-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: var(--blue-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.ecard-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 22px; letter-spacing: 0.01em;
    color: var(--ink); line-height: 1.15;
}
.ecard-desc {
    font-size: 13.5px; color: var(--ink2); line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 14px; max-width: 560px;
}
.ecard-img {
    width: 220px;
    height: auto;
    object-fit: cover;
    flex-shrink: 0;
}
.ecard-metas { display: flex; flex-wrap: wrap; gap: 14px; }
.meta {
    display: flex; align-items: center; gap: 5px;
    font-size: 13px; color: var(--ink2);
}
.meta svg { color: var(--muted); }

/* Pill */
.pill {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 100px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
}
.pill-open { background: var(--green-light); color: var(--green); }
.pill-open::before { content:''; width:5px;height:5px;border-radius:50%;background:var(--green);animation:pulse-g 2s infinite; }
.pill-full  { background: #fef3c7; color: #b45309; }
.pill-closed{ background: #fee2e2; color: #b91c1c; }

/* Side price */
.price-val {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900; font-size: 28px; letter-spacing: -0.01em;
    color: var(--ink); line-height: 1;
}
.price-free { font-family: 'Barlow Condensed',sans-serif; font-weight:900; font-size:22px; color: var(--green); }
.price-lbl  { font-size: 11px; color: var(--muted); letter-spacing:.04em; }

/* Register btn */
.btn-reg {
    width: 100%;
    background: var(--blue); color: white;
    padding: 10px 0; border-radius: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px; font-weight: 800; letter-spacing: 0.04em;
    border: none; cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn-reg:hover:not(:disabled) { background: #1e40af; transform: scale(1.02); }
.btn-reg:disabled { background: var(--muted); cursor: not-allowed; transform: none; }

/* Vacancy bar */
.vac-bar { padding: 14px 22px 16px 26px; border-top: 1px solid var(--border); }
.vac-track { height: 5px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.vac-fill  { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--blue), #93c5fd); transition: width 1s ease; }
.vac-fill.warn { background: linear-gradient(90deg, var(--orange), #fb923c); }
.vac-labels { display: flex; justify-content: space-between; margin-top: 5px; }
.vac-labels span { font-size: 11px; color: var(--muted); }

/* Steps */
.steps { display: flex; align-items: center; gap: 0; margin-bottom: 28px; }
.step-dot {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 13px;
    flex-shrink: 0; transition: all .25s ease;
}
.step-dot.active { background: var(--blue); color: white; box-shadow: 0 0 0 3px var(--blue-light); }
.step-dot.done   { background: var(--green-light); color: var(--green); border: 1.5px solid #86efac; }
.step-dot.idle   { background: var(--border); color: var(--muted); }
.step-label { font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-left: 6px; }
.step-line  { flex: 1; height: 2px; background: var(--border); margin: 0 10px; }
.step-line.done { background: #86efac; }

/* Event snippet */
.ev-snip {
    border: 1px solid var(--blue-light);
    background: var(--blue-light);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 28px;
    display: flex; align-items: center; gap: 12px;
}
.ev-snip-icon {
    width: 44px; height: 44px; border-radius: 8px;
    background: var(--blue); color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.ev-snip-img {
    width: 44px; height: 44px; border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.ev-snip-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 16px; color: var(--ink); line-height: 1.1;
}
.ev-snip-date { font-size: 12px; color: var(--blue); margin-top: 3px; }

/* Form */
.form-section-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800; font-size: 16px; letter-spacing: .04em; text-transform: uppercase;
    color: var(--ink2); margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.field-label {
    display: block; font-size: 12px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink2); margin-bottom: 7px;
}
.field {
    width: 100%;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 13px 15px;
    color: var(--ink);
    font-family: 'Barlow', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--muted); }
.field:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
    background: white;
}

/* OTP */
.otp-wrap { display: flex; gap: 8px; justify-content: center; }
.otp-digit {
    width: 50px; height: 58px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px; font-weight: 800;
    text-align: center; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.otp-digit:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px var(--blue-light);
    background: white;
}
.otp-digit.filled { border-color: var(--blue); background: white; }

/* Buttons */
.btn-primary {
    width: 100%; padding: 14px 20px;
    background: var(--blue); color: white;
    border-radius: 8px; border: none;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 18px; font-weight: 800; letter-spacing: .05em;
    cursor: pointer; transition: background .15s, transform .1s;
}
.btn-primary:hover:not(:disabled) { background: #1e40af; transform: scale(1.01); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.btn-ghost {
    width: 100%; padding: 10px;
    background: transparent; color: var(--muted);
    border: 1px solid var(--border); border-radius: 8px;
    font-family: 'Barlow', sans-serif; font-size: 13px;
    cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { color: var(--ink); border-color: #9ca3af; }

.btn-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 22px;
    border: 1.5px solid #86efac;
    color: var(--green);
    border-radius: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 16px;
    text-decoration: none;
    transition: all .15s;
}
.btn-back:hover { background: rgba(22,163,74,.1); }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* Alerts */
.alert { border-radius: 8px; padding: 12px 16px; font-size: 14px; display:none; margin-bottom: 12px; }
.alert.show { display: block; }
.alert-ok  { background: var(--green-light); border: 1px solid #86efac; color: var(--green); }
.alert-err { background: var(--red-light);   border: 1px solid #fca5a5; color: var(--red); }

/* Success */
.success-card {
    background: var(--green-light);
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 40px 24px; text-align: center;
}
.success-icon { font-size: 52px; margin-bottom: 12px; }
.success-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900; font-size: 26px; color: var(--green); margin-bottom: 8px;
}
.success-sub { font-size: 14px; color: var(--ink2); margin-bottom: 20px; line-height: 1.6; }

/* Skeleton */
.skel {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%; animation: shi 1.4s infinite; border-radius: 14px;
}
@keyframes shi { 0%{background-position:-200% 0;} 100%{background-position:200% 0;} }

.empty { text-align:center; padding:72px 24px; color:var(--muted); }
.empty .ico { font-size:52px; margin-bottom:12px; }

/* Spinner */
.spinner {
    display: inline-block; width: 14px; height: 14px;
    border: 2.5px solid rgba(255,255,255,.3);
    border-top-color: white; border-radius: 50%;
    animation: spin .7s linear infinite; vertical-align: middle; margin-right: 5px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fi .3s ease both; }
@keyframes fi { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:translateY(0);} }

footer {
    background: var(--ink); color: rgba(255,255,255,0.45);
    text-align: center; padding: 24px; font-size: 13px;
}
footer strong { color: rgba(255,255,255,0.8); }

@media(max-width:640px) {
    .ecard { flex-direction: column; }
    .ecard-img { width: 100%; height: 180px; }
    .ecard-inner { flex-direction: column; }
    .ecard-side { width: 100%; border-left: none; border-top: 1px solid var(--border); flex-direction: row; justify-content: space-between; }
}

@media(max-width:480px){
    .card-body { padding:20px 18px; }
    .card-header { padding:22px 18px; }
    .otp-digit { width:42px; height:52px; font-size:24px; }
}
