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

:root {
    --navy: #01223b;
    --navy-mid: #1d3b53;
    --gold: #0C6C39;
    --gold-light: #0C6C39;
    --gold-muted: rgb(12, 108, 57);
    --white: #ffffff;
    --off-white: #f7f8fa;
    --surface: #ffffff;
    --border: rgba(1,34,59,0.12);
    --border-strong: rgba(1,34,59,0.22);
    --text-primary: #01223b;
    --text-secondary: #4a6070;
    --text-muted: #8099aa;
    --success: #0f6e56;
    --error: #a32d2d;
    --error-bg: #fcebeb;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 22px;
    --shadow-sm: 0 1px 3px rgba(1,34,59,0.08), 0 0 0 0.5px rgba(1,34,59,0.06);
    --shadow-md: 0 4px 20px rgba(1,34,59,0.1), 0 0 0 0.5px rgba(1,34,59,0.07);
    --shadow-focus: 0 0 0 3px rgb(12, 108, 57);
}

body {

    background: #eef2f6;
    min-height: 100vh;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* HERO */
.hero {
    background:
        radial-gradient(ellipse 80% 60% at 70% 50%, var(--navy-mid) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(212,160,23,0.08) 0%, transparent 50%),
        linear-gradient(160deg, #01223b 0%, #01223b 100%);
    padding: 52px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 28px 28px;
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(212,160,23,0.14);
    border: 1px solid rgba(212,160,23,0.3);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    color: var(--gold-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-badge svg { width: 12px; height: 12px; }

.hero h1 {
    font-size: clamp(22px, 4vw, 32px);
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    margin-bottom: 10px;
}

.hero p {
    font-size: 14px;
    color: rgba(255,255,255,0.52);
    font-weight: 300;
}

/* MAIN LAYOUT */
.page-wrap {
    /*max-width: 1100px;*/
    margin: 0 auto;
    padding: 40px 20px 60px;
    display: grid;
    grid-template-columns: 1fr 1.45fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 820px) {
    .page-wrap { grid-template-columns: 1fr; }
}

/* RULES CARD */
.rules-card {
    background: var(--surface);
    /*border-radius: var(--radius-lg);*/
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.rules-header {
    background: var(--navy);
    padding: 22px 24px 20px;
}

.rules-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 6px;
}

.rules-header h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--white);
    line-height: 1.3;
}

.rules-header p {
    font-size: 12.5px;
    color: rgba(255,255,255,0.48);
    margin-top: 6px;
    line-height: 1.5;
}

.rules-body {
    padding: 20px 22px 24px;
}

.rule-item {
    display: flex;
    gap: 11px;
    padding: 10px 0;
    border-bottom: 0.5px solid var(--border);
    align-items: flex-start;
}

.rule-item:last-child { border-bottom: none; }

.rule-icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: rgba(212,160,23,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.rule-icon svg { width: 11px; height: 11px; color: var(--gold); }

.rule-item p {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.55;
}

/* FORM CARD */
.form-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* STEPPER */
.stepper-wrap {
    background: var(--off-white);
    border-bottom: 0.5px solid var(--border);
    padding: 20px 28px;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.step-item:not(:last-child)::after {
    content: '';
    flex: 1;
    height: 1.5px;
    background: var(--border);
    margin: 0 10px;
    transition: background 0.3s;
}

.step-item.completed:not(:last-child)::after {
    background: var(--gold);
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    transition: all 0.25s;
    border: 2px solid var(--border-strong);
    color: var(--text-muted);
    background: var(--white);
}

.step-item.active .step-circle {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
    box-shadow: 0 0 0 4px rgba(1,34,59,0.08);
}

.step-item.completed .step-circle {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}

.step-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.25s;
    white-space: nowrap;
}

.step-item.active .step-label { color: var(--navy); }
.step-item.completed .step-label { color: var(--gold); }

@media (max-width: 480px) { .step-label { display: none; } }

/* FORM BODY */
.form-body {
    padding: 28px 28px 24px;
    background-color: white;
}

.step-panel { display: none; }
.step-panel.active { display: block; }

.step-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.step-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
    letter-spacing: 0.01em;
}

.form-label span {
    color: #e24b4a;
    margin-left: 3px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--white);
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
}

.form-control:hover { border-color: var(--border-strong); }

/*.form-control:focus {*/
/*    border-color: var(--navy);*/
/*    box-shadow: var(--shadow-focus);*/
/*}*/

.form-control::placeholder { color: var(--text-muted); font-weight: 300; }

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%238099aa' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

.field-error {
    font-size: 12px;
    color: var(--error);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 0;
    overflow: hidden;
    transition: all 0.2s;
}

.field-error.visible { margin-top: 5px; }

.row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 500px) { .row-2 { grid-template-columns: 1fr; } }

/* MEMBER CARDS */
.members-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }

.member-card {
    background: var(--off-white);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color 0.2s;
}

.member-card:hover { border-color: var(--border-strong); }

.member-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: var(--white);
    border-bottom: 0.5px solid var(--border);
}

.member-num {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.member-badges { display: flex; align-items: center; gap: 7px; }

.badge-leader {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 100px;
    background: rgb(12, 108, 57);
    color: #ffffff;
    border: 1px solid rgb(1, 34, 59);
    display: none;
}

.badge-leader.visible { display: inline-flex; }

.btn-remove {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}

.btn-remove:hover {
    background: var(--error-bg);
    border-color: rgba(162,45,45,0.25);
    color: var(--error);
}

.btn-remove svg { width: 12px; height: 12px; }

.member-fields {
    padding: 14px 16px 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.member-fields .full { grid-column: 1 / -1; }

@media (max-width: 480px) {
    .member-fields { grid-template-columns: 1fr; }
    .member-fields .full { grid-column: 1; }
}

.member-footer {
    padding: 10px 16px 14px;
    border-top: 0.5px solid var(--border);
    background: var(--white);
}

.leader-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.toggle-track {
    width: 36px;
    height: 20px;
    border-radius: 100px;
    background: var(--border-strong);
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s;
}

.toggle-track.on { background: var(--navy); }

.toggle-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--white);
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

.toggle-track.on .toggle-thumb { transform: translateX(16px); }

.hidden-checkbox { position: absolute; opacity: 0; pointer-events: none; }

.btn-add-member {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-md);
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

.btn-add-member:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: rgba(1,34,59,0.03);
}

.btn-add-member svg { width: 14px; height: 14px; }

.team-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    border-radius: 100px;
    font-size: 11.5px;
    font-weight: 500;
    background: var(--off-white);
    border: 0.5px solid var(--border);
    color: var(--text-secondary);
}

.stat-pill .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--border-strong);
}

.stat-pill.ok .dot { background: var(--success); }
.stat-pill.warn .dot { background: var(--gold); }
.stat-pill.error .dot { background: var(--error); }

.global-error {
    background: var(--error-bg);
    border: 1px solid rgba(162,45,45,0.2);
    border-radius: var(--radius-sm);
    padding: 9px 13px;
    font-size: 12.5px;
    color: var(--error);
    margin-bottom: 16px;
    display: none;
}

.global-error.visible { display: block; }

/* NAV BUTTONS */
.form-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px 24px;
    border-top: 0.5px solid var(--border);
    background: var(--off-white);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    /*border-radius: var(--radius-md);*/
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    border: none;
    outline: none;
    line-height: 1;
}

.btn svg { width: 15px; height: 15px; }

.btn-back {
    background: var(--white);
    border: 1.5px solid var(--border-strong);
    color: var(--text-secondary);
}

.btn-back:hover {
    background: var(--off-white);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.btn-next {
    background: var(--navy);
    color: var(--white);
    margin-left: auto;
}

.btn-next:hover { background: #01324f; }
.btn-next:active { transform: scale(0.98); }

.btn-submit {
    background: linear-gradient(135deg, #0f5e4c, #0f6e56);
    color: var(--white);
    margin-left: auto;
}

.btn-submit:hover { filter: brightness(1.07); }
.btn-submit:active { transform: scale(0.98); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

/* SUCCESS STATE */
.success-screen {
    display: none;
    text-align: center;
    padding: 56px 32px;
}

.success-screen.visible { display: block; background-color: white}

.success-icon {
    width: 64px;
    height: 64px;
    background: rgba(15,110,86,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg { width: 30px; height: 30px; color: var(--success); }

.success-screen h3 {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.success-screen p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ERROR SCREEN */
.error-screen {
    display: none;
    padding: 40px 32px 36px;
}

.error-screen.visible { display: block; }

.error-screen-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.error-screen-icon {
    width: 48px;
    height: 48px;
    background: var(--error-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.error-screen-icon svg { width: 22px; height: 22px; color: var(--error); }

.error-screen-header-text h3 {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.error-screen-header-text p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.error-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.error-list-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--error-bg);
    border: 1px solid rgba(162,45,45,0.15);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.error-list-item:hover {
    border-color: rgba(162,45,45,0.35);
    background: #f9dede;
}

.error-list-item-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--error);
    flex-shrink: 0;
    margin-top: 5px;
}

.error-list-item-body { flex: 1; }

.error-list-item-field {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #7a2020;
    margin-bottom: 2px;
}

.error-list-item-msg {
    font-size: 13px;
    color: var(--error);
    line-height: 1.4;
}

.error-list-item-arrow {
    font-size: 12px;
    color: #b84444;
    flex-shrink: 0;
    margin-top: 2px;
}

.btn-try-again {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    background: var(--navy);
    color: var(--white);
    border: none;
    transition: background 0.18s;
}

.btn-try-again:hover { background: #01324f; }
.btn-try-again svg { width: 14px; height: 14px; }

.form-wrapper { position: relative; }
