/* ═══════════════════════════════════════════════════════════
   BoxCricket — Auth Pages (Login / Register)
   Split layout on desktop, stacked on mobile
   ═══════════════════════════════════════════════════════════ */

/* Override generic auth-page from app.css for split-layout pages */
.auth-page {
    min-height: calc(100vh - 80px);
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    align-items: stretch !important;
    justify-content: initial !important;
    padding: 0 !important;
    background: var(--bg, #f8fafc) !important;
    gap: 0;
    max-width: 100%;
    overflow: hidden;
}

/* ─────── LEFT PANEL (brand / marketing) ─────── */
.auth-left {
    position: relative;
    background: linear-gradient(135deg, var(--navy, #0B2545) 0%, var(--navy-light, #1B3A6B) 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: 100%;
}
.auth-left::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(163, 230, 53, 0.2) 0%, transparent 70%);
    pointer-events: none;
}
.auth-left::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: -120px;
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, rgba(94, 158, 214, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand {
    position: relative;
    z-index: 2;
}
.auth-brand .navbar-brand {
    font-size: 22px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
}
.auth-brand .brand-icon { font-size: 1.4rem; }

.auth-left-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 0;
}
.auth-left-content h2 {
    font-family: var(--font-head, inherit);
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
    color: #fff;
}
.auth-left-content p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 28px;
    max-width: 440px;
}

.feature-checklist {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.feature-checklist div {
    font-size: 14.5px;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.auth-left-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 8px;
}
.auth-left-stats > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    text-align: center;
}
.auth-left-stats strong {
    font-family: var(--font-head, inherit);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--lime, #a3e635);
    line-height: 1;
}
.auth-left-stats span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-left-decor {
    position: absolute;
    bottom: 24px;
    right: 32px;
    font-size: 3.5rem;
    opacity: 0.15;
    z-index: 1;
    pointer-events: none;
}

/* ─────── RIGHT PANEL (form) ─────── */
.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    min-height: 100%;
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-lg, 16px);
    padding: 40px 36px !important;
    max-width: 480px !important;
    width: 100%;
    box-shadow: var(--shadow-lg, 0 10px 30px rgba(11,37,69,0.08));
    border: 1px solid var(--border, #e2e8f0);
    box-sizing: border-box;
}

.auth-title,
.auth-card h1.auth-title {
    font-family: var(--font-head, inherit);
    font-size: 1.6rem !important;
    font-weight: 800;
    color: var(--navy, #0B2545);
    margin: 0 0 10px !important;
    letter-spacing: -0.3px;
    line-height: 1.2;
    text-align: left;
}

.auth-subtitle {
    font-size: 13.5px;
    color: var(--text-light, #64748B);
    margin: 0 0 22px;
}

/* ─────── FORM ─────── */
.auth-card .form-group {
    margin-bottom: 16px;
}
.auth-card .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #0B2545);
    margin-bottom: 6px;
}
.auth-card .form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text, #0B2545);
    background: #fff;
    transition: border-color 0.18s, box-shadow 0.18s;
    box-sizing: border-box;
}
.auth-card .form-control:focus {
    outline: none;
    border-color: var(--navy, #0B2545);
    box-shadow: 0 0 0 3px rgba(11, 37, 69, 0.08);
}
.auth-card .form-control::placeholder {
    color: #9ca3af;
}
.auth-card .form-control.is-invalid {
    border-color: #ef4444;
}
.auth-card .form-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 5px;
}

/* Two-column responsive grid */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Password field with eye toggle */
.password-field {
    position: relative;
}
.password-field .form-control {
    padding-right: 42px;
}
.password-field .toggle-password {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--text-light, #64748B);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.password-field .toggle-password:hover {
    color: var(--navy, #0B2545);
}

/* Role banners */
.auth-card .info-banner {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 18px;
    border-left: 3px solid;
    line-height: 1.5;
}
.auth-card .info-banner.player {
    background: #eff6ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}
.auth-card .info-banner.owner {
    background: #ecfdf5;
    border-left-color: #10b981;
    color: #065f46;
}
.auth-card .info-banner a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

/* Terms checkbox row */
.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 6px 0 18px;
}
.auth-terms input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--navy, #0B2545);
    cursor: pointer;
    flex-shrink: 0;
}
.auth-terms label {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text-light, #64748B);
    cursor: pointer;
    margin: 0;
}
.auth-terms label a {
    color: var(--navy, #0B2545);
    font-weight: 600;
}

/* Submit button */
.auth-card button[type="submit"].btn-primary {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 700;
    border-radius: 10px;
    margin-top: 4px;
}

/* Footer link below form */
.auth-footer-text {
    text-align: center;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border, #e2e8f0);
    color: var(--text-light, #64748B);
    font-size: 13.5px;
}
.auth-footer-text a {
    color: var(--navy, #0B2545);
    font-weight: 700;
}

/* Password strength bar */
#strengthBar {
    height: 4px;
    border-radius: 3px;
    background: #e2e8f0;
    margin: -8px 0 14px;
    overflow: hidden;
}
#strengthFill {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    border-radius: 3px;
}

/* Alert inside auth card */
.auth-card .alert {
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.auth-card .alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ─────── SOCIAL AUTH (Google circular icon) ─────── */
.social-auth {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 4px 0 4px;
}

.social-auth-btn {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .18s;
    text-decoration: none;
    padding: 0;
}
.social-auth-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 4px 10px rgba(11, 37, 69, 0.08);
    transform: translateY(-2px);
}
.social-auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(11, 37, 69, 0.06);
}
.social-auth-btn svg {
    flex-shrink: 0;
}

/* Divider between main submit and social row */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 14px;
    color: var(--text-muted, #64748B);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border, #e2e8f0);
}
.auth-divider span {
    white-space: nowrap;
    font-weight: 600;
}

/* ─────── LOGIN PAGE VARIANT (centered card) ─────── */
.auth-page.auth-page-centered {
    grid-template-columns: 1fr;
    place-items: center;
    padding: 40px 20px !important;
    background: linear-gradient(135deg, var(--navy), var(--navy-light)) !important;
}
.auth-page.auth-page-centered .auth-card {
    max-width: 440px !important;
}
.auth-page.auth-page-centered .auth-card h2 {
    color: var(--navy);
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
}
.auth-page.auth-page-centered .auth-card .subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ─────── TABLET ─────── */
@media (max-width: 1024px) {
    .auth-left { padding: 40px 40px; }
    .auth-left-content h2 { font-size: 1.9rem; }
    .auth-right { padding: 40px 32px; }
    .auth-card { padding: 32px 28px !important; }
}

/* ─────── MOBILE (stack, hide left panel marketing) ─────── */
@media (max-width: 820px) {
    .auth-page {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 70px);
    }
    .auth-left {
        padding: 24px 20px 20px;
        min-height: auto;
    }
    .auth-left::before,
    .auth-left::after,
    .auth-left-decor { display: none; }
    .auth-brand { display: none; } /* navbar already shows brand */
    .auth-left-content {
        padding: 0;
        text-align: center;
    }
    .auth-left-content h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    .auth-left-content p {
        font-size: 14px;
        margin: 0 auto 20px;
        text-align: center;
    }
    .feature-checklist {
        display: none; /* save space on mobile */
    }
    .auth-left-stats {
        gap: 10px;
        margin-top: 14px;
    }
    .auth-left-stats > div {
        padding: 12px 8px;
    }
    .auth-left-stats strong { font-size: 1.25rem; }
    .auth-left-stats span { font-size: 10.5px; }

    .auth-right {
        padding: 20px 16px 40px;
    }
    .auth-card {
        padding: 26px 22px !important;
        border-radius: 14px;
    }
    .auth-title,
    .auth-card h1.auth-title {
        font-size: 1.35rem !important;
    }
}

@media (max-width: 480px) {
    .auth-left { padding: 20px 16px 16px; }
    .auth-left-content h2 { font-size: 1.3rem; }
    .auth-left-content p { font-size: 13px; margin-bottom: 14px; }
    .auth-left-stats { gap: 8px; }
    .auth-left-stats strong { font-size: 1.1rem; }
    .auth-left-stats > div { padding: 10px 6px; }

    .auth-right { padding: 16px 12px 32px; }
    .auth-card { padding: 22px 18px !important; }

    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
