﻿/* ======================================================
   Dwibble – Core UI
   ====================================================== */

/* =========================
   Reset / Base
   ========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: radial-gradient(circle at top, #1a2435 0%, #0b1320 45%, #070d16 100%);
    min-height: 100vh;
    color: var(--text-primary);
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================
   Auth Layout
   ========================= */

.dw-auth-wrap {
    min-height: 100vh;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark .dw-auth-wrap {
    background: radial-gradient(circle at top, #0b0e13 0%, #06080c 60%, #030405 100%);
}

body.light .dw-auth-wrap {
    background: #f5f7fa;
}

/* =========================
   Auth Panel
   ========================= */

.dw-auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 40px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.02);
}

    /* Headings */

    .dw-auth-panel h1 {
        margin: 0 0 6px;
        text-align: center;
        font-size: 34px;
        font-weight: 700;
        letter-spacing: 0.5px;
    }

    .dw-auth-panel h2 {
        margin: 0 0 28px;
        text-align: center;
        font-size: 16px;
        font-weight: 500;
        color: var(--text-secondary);
    }

/* =========================
   Login Logo
   ========================= */

.dw-login-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 28px;
}

    .dw-login-logo img {
        width: clamp(100px, 25vw, 140px);
        height: auto;
        /* 🔥 better for transparent images */
        filter: drop-shadow(0 8px 20px rgba(0,0,0,0.6)) drop-shadow(0 0 8px rgba(255,255,255,0.05));
    }

/* =========================
   Form Fields
   ========================= */

.dw-auth-field {
    margin-bottom: 14px;
}

/* DROPDOWN FIX */
.dw-input {
    width: 100%;
    padding: 14px 16px;
    background: #0b1220;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: #ffffff !important;
    font-size: 15px;
    transition: all 0.2s ease;
}

    .dw-input::placeholder {
        color: #8fa3bf;
    }

    .dw-input:focus {
        outline: none;
        border-color: var(--brand-accent-primary);
        box-shadow: 0 0 0 1px rgba(var(--brand-accent-primary-rgb), 0.4), 0 0 10px rgba(var(--brand-accent-primary-rgb), 0.25);
    }
/* Dropdown arrow + options */
select.dw-input {
    color: #ffffff;
}

    /* Options (important for visibility when opened) */
    select.dw-input option {
        background: #0b1220;
        color: #ffffff;
    }

/* =========================
   Buttons
   ========================= */

.dw-btn-primary {
    width: 100%;
    margin-top: 18px;
    padding: 14px;
    background: var(--brand-accent-primary);
    border: none;
    border-radius: 10px;
    color: #000;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .dw-btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 18px rgba(var(--brand-accent-primary-rgb), 0.35);
    }

    .dw-btn-primary:active {
        transform: translateY(0);
        box-shadow: none;
    }

/* =========================
   Auth Links
   ========================= */

.dw-auth-links {
    text-align: center;
    margin-top: 20px;
}

    .dw-auth-links a {
        color: var(--text-secondary);
        font-size: 14px;
    }

        .dw-auth-links a:hover {
            color: var(--text-primary);
        }

/* =========================
   Error Messages
   ========================= */

.dw-auth-error {
    display: block;
    margin-top: 14px;
    text-align: center;
    font-weight: 600;
    color: #ff6b6b;
}

/* =========================
   Menu Branding
   ========================= */

.dw-menu-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
}

.dw-club-badge {
    max-width: 160px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.45));
}

.dw-badge-wrap {
    width: 180px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

/* =========================
   Menu Grid
   ========================= */

.dw-menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-top: 14px;
}

.dw-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    padding: 12px 10px;
    background: #0f131a;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: #ffffff; /* 🔥 THIS FIXES IT */

    font-weight: 600;
    text-align: center;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
}
    .dw-menu-item:hover {
        transform: translateY(-3px);
        background: #1b2130;
        border-color: var(--brand-accent-primary);
        color: var(--brand-accent-primary);
        box-shadow: 0 6px 14px rgba(0,0,0,0.35), 0 0 8px rgba(var(--brand-accent-primary-rgb), 0.25);
    }

    .dw-menu-item.disabled {
        opacity: 0.45;
        cursor: default;
        pointer-events: none;
    }

/* =========================
   Responsive
   ========================= */

@media (max-width: 520px) {

    .dw-menu {
        grid-template-columns: 1fr;
    }

    .dw-auth-wrap {
        padding: 20px;
    }

    .dw-input {
        font-size: 16px; /* prevents iOS zoom */
    }
}

/* =========================
   Password Strength
   ========================= */

.pw-strength {
    width: 100%;
    height: 6px;
    background: #1f2937;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

#pwStrengthBar {
    height: 100%;
    width: 0%;
    transition: width 0.25s ease;
}

.pw-weak {
    background: #ef4444;
}

.pw-medium {
    background: #f59e0b;
}

.pw-strong {
    background: #22c55e;
}

.pw-strength-text,
.pw-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* =========================
   Password Toggle
   ========================= */

.pw-field {
    position: relative;
}

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #94a3b8;
    user-select: none;
}

    .pw-toggle:hover {
        color: #ffffff;
    }

/* =========================================
   Remember Me Toggle
   ========================================= */

.dw-auth-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 10px;
}

/* Switch container */
.dw-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

    /* Hide default checkbox */
    .dw-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

/* Slider background */
.dw-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #1f2937;
    border-radius: 20px;
    transition: 0.2s;
}

    /* Slider knob */
    .dw-slider:before {
        content: "";
        position: absolute;
        height: 14px;
        width: 14px;
        left: 3px;
        top: 3px;
        background-color: #fff;
        border-radius: 50%;
        transition: 0.2s;
    }

/* Checked state */
.dw-switch input:checked + .dw-slider {
    background-color: var(--brand-accent-primary);
}

    .dw-switch input:checked + .dw-slider:before {
        transform: translateX(18px);
    }

/* Label */
.dw-remember-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.dw-switch:hover .dw-slider {
    box-shadow: 0 0 6px rgba(var(--brand-accent-primary-rgb), 0.4);
}

/* =========================================
   Login Spinner
   ========================================= */

.dw-login-spinner {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}

.dw-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top: 3px solid var(--brand-accent-primary);
    border-radius: 50%;
    animation: dw-spin 0.8s linear infinite;
}

@keyframes dw-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button loading state */
.dw-btn-primary.loading {
    opacity: 0.7;
    pointer-events: none;
}

.dw-link-muted {
    color: #9ca3af;
    font-size: 13px;
    text-decoration: none;
}

    .dw-link-muted:hover {
        color: #f59e0b;
    }

.dw-auth-subtitle {
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
    margin-bottom: 18px;
}

.legend-toggle-btn {
    width: 26px;
    height: 16px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

    /* Base line */
    .legend-toggle-btn::before,
    .legend-toggle-btn::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--brand-accent-primary);
        transition: all 0.2s ease;
    }

    /* Top line */
    .legend-toggle-btn::before {
        top: 4px;
    }

    /* Bottom line */
    .legend-toggle-btn::after {
        bottom: 4px;
    }

    /* 🔥 ACTIVE (double line visible) */
    .legend-toggle-btn.double::before {
        opacity: 1;
    }

    .legend-toggle-btn.double::after {
        opacity: 1;
    }

    /* 🔥 INACTIVE (collapse to single line) */
    .legend-toggle-btn:not(.double)::after {
        opacity: 0;
        transform: scaleX(0.5);
    }

    /* Hover glow */
    .legend-toggle-btn:hover::before,
    .legend-toggle-btn:hover::after {
        box-shadow: 0 0 6px color-mix(in srgb, var(--brand-accent-primary) 60%, transparent);
    }