/* 1. Theme Variables */
:root {
    --primary-bg: #0a0a0a;
    --secondary-bg: #1a1a1a;
    --accent-red: #ff6b6b;         /* Pastel Red */
    --accent-red-dim: rgba(255, 107, 107, 0.15);
    --accent-red-glow: rgba(255, 107, 107, 0.4);
    --text-main: #ffffff;
    --text-dim: #94a3b8;
    --glass-bg: rgba(26, 26, 26, 0.85);
    --input-bg: rgba(15, 15, 15, 0.7);
}

/* 2. Reset & Base Layout */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Montserrat', sans-serif;
}

body.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--primary-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* 3. Layout Components */
.main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

/* Update your existing Section 2 */
body.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--primary-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Update your Section 3 to ensure the box is perfectly centered */
.auth-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center; /* This centers the box vertically */
    padding: 40px 20px;
    background: radial-gradient(circle at top right, var(--accent-red-dim), transparent);
}

/* Ensure the logo looks consistent */
.logo-image {
    height: 40px;
    object-fit: contain;
}
/* 4. The Auth/Registration Box */
.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 107, 107, 0.2);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.registration-wide {
    max-width: 600px; /* Expands for the match form */
}

/* 5. Typography */
h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #fff, var(--accent-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h3 {
    color: var(--accent-red);
    font-size: 1.1rem;
    margin: 20px 0 10px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

p.toggle-text {
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.sub-label {
    font-size: 0.75rem;
    color: var(--accent-red);
    font-weight: bold;
    margin-bottom: 10px;
    text-align: left;
}

/* 6. Form Elements */
.form-section {
    margin-bottom: 25px;
    text-align: left;
}

.input-row {
    display: flex;
    gap: 15px;
}

.input-row input {
    flex: 1;
}

input, select, textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin-bottom: 12px;
}

textarea {
    resize: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-red);
    background: rgba(15, 15, 15, 0.9);
    box-shadow: 0 0 0 4px var(--accent-red-dim);
}

/* 7. Match Registration Radio & Checkbox Styling ONLY */

.radio-group,
.waivers {
    display: flex;
    flex-direction: column;
    gap: 14px;

    padding: 16px;

    background: rgba(255, 255, 255, 0.03);

    border-radius: 14px;

    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* RADIO + CHECKBOX ROWS */

.radio-group label,
.waivers label {
    display: flex;
    align-items: center;

    gap: 12px;

    width: 100%;

    padding: 14px 16px;

    margin: 0;

    background: rgba(255,255,255,0.025);

    border: 1px solid rgba(255,255,255,0.04);

    border-radius: 12px;

    cursor: pointer;

    transition: all 0.2s ease;

    color: var(--text-dim);

    line-height: 1.4;
}

.radio-group label:hover,
.waivers label:hover {
    border-color: rgba(255,107,107,0.3);

    background: rgba(255,255,255,0.045);
}

/* FIX GLITCHING INPUTS */

.radio-group input[type="radio"],
.waivers input[type="checkbox"] {
    margin: 0;

    width: 18px;
    height: 18px;

    flex-shrink: 0;

    accent-color: var(--accent-red);

    position: relative;
    top: 0;
}

/* BETTER TEXT ALIGNMENT */

.radio-group span,
.waivers span {
    flex: 1;
}

/* 8. Buttons & Links */
#auth-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    background: var(--accent-red);
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

#auth-btn:hover {
    background: #ff8787;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-red-glow);
}

#link {
    color: var(--accent-red);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

#link:hover {
    opacity: 0.8;
}

/* 9. Utilities */
.confirmation-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 15px;
}

.message {
    margin-top: 16px;
    min-height: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================= */
/* IMPROVED MOBILE UX */
/* ============================= */

@media (max-width: 768px) {

    /* Prevent iOS zoom on inputs */
    input,
    select,
    textarea,
    button {
        font-size: 16px;
    }

    body.auth-page {
        overflow-x: hidden;
    }

    /* Better safe spacing */
    .auth-wrapper {
        padding: 20px 14px 40px;
        align-items: flex-start;
    }

    /* Header cleanup */
    .main-header {
        padding: 16px;
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(10,10,10,0.92);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .logo-image {
        height: 32px;
    }

    .sign-in-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }

    /* Form Card */
    .auth-box {
        width: 100%;
        max-width: 100%;
        padding: 24px 18px;
        border-radius: 20px;
    }

    .registration-wide {
        max-width: 100%;
    }

    /* Typography */
    h2 {
        font-size: 1.7rem;
        line-height: 1.1;
    }

    h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    p,
    label,
    .confirmation-note {
        line-height: 1.5;
    }

    /* Inputs */
    input,
    select,
    textarea {
        padding: 16px;
        border-radius: 14px;
        margin-bottom: 14px;
    }

    textarea {
        min-height: 120px;
    }

    /* Stack rows */
    .input-row {
        flex-direction: column;
        gap: 0;
    }

    /* Better radio buttons */
    .radio-group {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 18px;
    }

    .radio-group label {
        display: flex;
        align-items: center;
        gap: 10px;
        background: rgba(255,255,255,0.03);
        padding: 14px;
        border-radius: 12px;
    }

    /* Better waiver spacing */
    .waivers {
        padding: 18px;
    }

    .waivers label {
        line-height: 1.5;
        margin-bottom: 14px;
    }

    /* Bigger submit button */
    #auth-btn {
        padding: 18px;
        font-size: 1rem;
        border-radius: 16px;
        position: sticky;
        bottom: 10px;
    }

    /* Better spacing between sections */
    .form-section {
        margin-bottom: 28px;
    }

    /* Message visibility */
    .message {
        font-size: 0.95rem;
        margin-top: 18px;
        text-align: center;
    }
}

/* ============================= */
/* EXTRA SMALL DEVICES */
/* ============================= */

@media (max-width: 400px) {

    .auth-box {
        padding: 20px 14px;
    }

    h2 {
        font-size: 1.45rem;
    }

    input,
    select,
    textarea {
        padding: 14px;
    }

    #auth-btn {
        padding: 16px;
    }
}

/* ============================= */
/* SMOOTHER MOBILE SCROLLING */
/* ============================= */

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea,
select,
button {
    touch-action: manipulation;
}

/* ============================= */
/* BETTER MOBILE KEYBOARD UX */
/* ============================= */

input:focus,
textarea:focus,
select:focus {
    transform: translateY(-1px);
}

/* ============================= */
/* SAFE AREA SUPPORT (IPHONES) */
/* ============================= */

.auth-wrapper {
    padding-bottom: calc(40px + env(safe-area-inset-bottom));
}