/* ==========================================================================
   SWEET TASKS - AUTHENTICATION PAGES STYLESHEET
   (signin.php, signup.php, forgot-password.php, reset-password.php)
   Theme: Dark Luxury Cyberpunk & Glassmorphism
   Responsive Architecture: Generous Mobile Header Clearance & Fluid Scaling
   ========================================================================== */

/* ── 0. MAIN LAYOUT & NATURAL FULL-PAGE SCROLL ────────────────────────────── */
html {
    scroll-behavior: smooth;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Ensure Header on auth pages sits naturally in the document flow */
.header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    z-index: 100;
    flex-shrink: 0;
}

.main-content.auth-main-layout {
    flex: 1 0 auto;
    width: 100%;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: clamp(1.5rem, 3.5vw, 2.75rem) !important;
    padding-bottom: clamp(1.75rem, 4vw, 3rem) !important;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    overflow: visible !important;
}

.footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* ── 1. AUTH CONTAINER & WRAPPER ──────────────────────────────────────────── */
.auth-container {
    width: 100%;
    padding: 0 !important;
    margin: 0 auto;
    position: relative;
    box-sizing: border-box;
    overflow: visible !important;
}

/* Ambient Cyber Glow Orbs (Contained without causing horizontal scroll) */
.auth-container::before {
    content: '';
    position: absolute;
    top: -40px;
    right: 10%;
    width: clamp(240px, 40vw, 420px);
    height: clamp(240px, 40vw, 420px);
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(6, 182, 212, 0.12) 50%, transparent 70%);
    filter: blur(50px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.auth-container::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: 10%;
    width: clamp(220px, 35vw, 380px);
    height: clamp(220px, 35vw, 380px);
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, rgba(37, 99, 235, 0.08) 50%, transparent 70%);
    filter: blur(50px);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.auth-wrapper {
    max-width: min(480px, calc(100vw - 20px));
    width: 100%;
    padding: 0 clamp(0.55rem, 2vw, 1.25rem);
    position: relative;
    z-index: 1;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Slightly wider wrapper for multi-field forms like signup */
.auth-wrapper.auth-wrapper-wide {
    max-width: min(530px, calc(100vw - 20px));
}

/* ── 2. CYBER GLASS AUTH CARD ────────────────────────────────────────────── */
.auth-card {
    background: var(--gradient-header, linear-gradient(135deg, rgba(15, 32, 67, 0.95) 0%, rgba(10, 20, 42, 0.97) 60%, rgba(6, 11, 24, 0.98) 100%));
    border: 1px solid var(--border-cyber-subtle, rgba(37, 99, 235, 0.28));
    border-radius: clamp(14px, 2.5vw, 22px);
    padding: clamp(1.15rem, 3.5vw, 2.25rem);
    box-shadow: 0 25px 65px -12px rgba(0, 0, 0, 0.85), 0 0 35px rgba(37, 99, 235, 0.16);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.6), rgba(37, 99, 235, 0.8), transparent);
    border-radius: 2px;
}

.auth-card:hover {
    border-color: rgba(56, 189, 248, 0.42);
    box-shadow: 0 30px 75px -10px rgba(0, 0, 0, 0.9), 0 0 45px rgba(37, 99, 235, 0.25);
}

/* ── 3. AUTH HEADER & BADGES ─────────────────────────────────────────────── */
.auth-header {
    text-align: center;
    margin-bottom: clamp(0.9rem, 2.5vw, 1.5rem);
    position: relative;
    z-index: 1;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: clamp(2px, 0.8vw, 4px) clamp(8px, 1.5vw, 12px);
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-cyan, #38bdf8);
    font-size: clamp(0.62rem, 1.5vw, 0.72rem);
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: clamp(6px, 1.5vw, 10px);
    text-transform: uppercase;
}

.auth-icon {
    width: clamp(38px, 6vw, 56px);
    height: clamp(38px, 6vw, 56px);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25) 0%, rgba(6, 182, 212, 0.2) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: clamp(10px, 1.8vw, 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto clamp(0.45rem, 1.5vw, 0.85rem);
    box-shadow: 0 0 25px rgba(37, 99, 235, 0.35), inset 0 0 15px rgba(56, 189, 248, 0.15);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.auth-card:hover .auth-icon {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 0 35px rgba(56, 189, 248, 0.5), inset 0 0 20px rgba(56, 189, 248, 0.25);
}

.auth-icon i {
    font-size: clamp(1.05rem, 2.5vw, 1.5rem);
    color: #38bdf8;
    filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.5));
}

.auth-icon.amber {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(217, 119, 6, 0.2) 100%);
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.35);
}
.auth-icon.amber i {
    color: #fbbf24;
    filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.5));
}

.auth-icon.emerald {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(5, 150, 105, 0.2) 100%);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}
.auth-icon.emerald i {
    color: #34d399;
    filter: drop-shadow(0 2px 8px rgba(16, 185, 129, 0.5));
}

.auth-title {
    font-size: clamp(1.15rem, 3.2vw, 1.55rem);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-white, #ffffff);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    background: var(--gradient-text-metallic, linear-gradient(135deg, #ffffff 15%, #f0f9ff 50%, #93c5fd 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    font-size: clamp(0.72rem, 1.8vw, 0.84rem);
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.45;
    margin: 0;
}

/* ── 4. FORM GROUPS & SLEEK INPUTS ───────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
}

.form-row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.5rem, 1.5vw, 0.85rem);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 540px) {
    .form-row-two {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-group {
    margin-bottom: clamp(0.65rem, 1.8vw, 1rem);
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: clamp(0.72rem, 1.6vw, 0.80rem);
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
    letter-spacing: 0.01em;
}

.form-label i {
    font-size: clamp(0.72rem, 1.6vw, 0.80rem);
    color: var(--text-cyan, #38bdf8);
}

.form-control {
    width: 100%;
    height: clamp(38px, 4.2vw, 42px);
    padding: 0.45rem clamp(0.65rem, 1.5vw, 0.9rem);
    font-family: inherit;
    font-size: clamp(0.80rem, 1.8vw, 0.88rem);
    color: #ffffff;
    background: rgba(10, 18, 36, 0.75);
    border: 1px solid rgba(37, 99, 235, 0.28);
    border-radius: clamp(8px, 1.5vw, 11px);
    transition: all 0.25s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1));
    box-sizing: border-box;
}

.form-control:focus {
    background: rgba(10, 18, 36, 0.95);
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), 0 0 16px rgba(56, 189, 248, 0.15);
    outline: none;
    color: #ffffff;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.55);
    font-size: clamp(0.76rem, 1.7vw, 0.84rem);
}

.form-help {
    display: block;
    font-size: clamp(0.66rem, 1.4vw, 0.72rem);
    color: #94a3b8;
    margin-top: 0.25rem;
}

.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .form-control {
    padding-right: 2.5rem;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: #38bdf8;
}

.password-toggle i {
    font-size: clamp(0.80rem, 1.8vw, 0.90rem);
}

/* ── 5. FORM OPTIONS & CHECKBOXES ────────────────────────────────────────── */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: clamp(0.65rem, 1.8vw, 1rem);
    flex-wrap: wrap;
    gap: 0.4rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: clamp(0.72rem, 1.6vw, 0.80rem);
    color: #cbd5e1;
    user-select: none;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-custom {
    width: clamp(15px, 2vw, 17px);
    height: clamp(15px, 2vw, 17px);
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 4px;
    background: rgba(15, 28, 52, 0.7);
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.checkbox-label:hover .checkbox-custom {
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: clamp(0.55rem, 1.2vw, 0.65rem);
}

.checkbox-text {
    line-height: 1.35;
}

.checkbox-text a,
.link-inline {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.checkbox-text a:hover,
.link-inline:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.forgot-password-link {
    color: #38bdf8;
    text-decoration: none;
    font-size: clamp(0.72rem, 1.6vw, 0.80rem);
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-password-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* ── 6. BUTTONS & CTA ────────────────────────────────────────────────────── */
.btn-auth {
    width: 100%;
    height: clamp(38px, 4.5vw, 44px);
    min-height: clamp(38px, 4.5vw, 44px);
    padding: 0 1.25rem;
    font-size: clamp(0.82rem, 1.8vw, 0.90rem);
    font-weight: 700;
    border-radius: clamp(8px, 1.5vw, 11px);
    background: var(--gradient-btn-primary, linear-gradient(135deg, #2563eb 0%, #1d4ed8 50%, #06b6d4 100%));
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: clamp(0.65rem, 1.8vw, 1rem);
    box-sizing: border-box;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.65), 0 0 18px rgba(56, 189, 248, 0.45);
    color: #ffffff;
}

.btn-auth:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.btn-auth:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ── 7. DIVIDER & SOCIAL LOGINS ──────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: clamp(0.65rem, 1.8vw, 1rem) 0;
    color: #64748b;
    font-size: clamp(0.68rem, 1.5vw, 0.76rem);
    font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 0.65rem;
}

.social-auth {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(0.5rem, 1.5vw, 0.75rem);
    margin-bottom: clamp(0.65rem, 1.8vw, 1rem);
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 360px) {
    .social-auth {
        grid-template-columns: 1fr;
    }
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: clamp(34px, 4vw, 40px);
    padding: 0 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: clamp(7px, 1.2vw, 10px);
    background: rgba(15, 28, 52, 0.6);
    color: #e2e8f0;
    font-size: clamp(0.72rem, 1.6vw, 0.82rem);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.social-btn.google:hover {
    border-color: rgba(234, 67, 53, 0.6);
    background: rgba(234, 67, 53, 0.12);
    color: #ea4335;
    box-shadow: 0 4px 16px rgba(234, 67, 53, 0.25);
}

.social-btn.facebook:hover {
    border-color: rgba(24, 119, 242, 0.6);
    background: rgba(24, 119, 242, 0.12);
    color: #3b82f6;
    box-shadow: 0 4px 16px rgba(24, 119, 242, 0.25);
}

.social-btn i {
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
}

/* ── 8. AUTH FOOTER & LINK STYLES ────────────────────────────────────────── */
.auth-footer {
    text-align: center;
    margin-top: clamp(0.65rem, 1.8vw, 1rem);
}

.auth-footer p {
    font-size: clamp(0.74rem, 1.6vw, 0.82rem);
    color: #94a3b8;
    margin: 0;
}

.auth-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.auth-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.auth-admin-link {
    margin-top: clamp(0.45rem, 1.2vw, 0.70rem);
    padding-top: clamp(0.45rem, 1.2vw, 0.70rem);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: clamp(0.70rem, 1.5vw, 0.78rem);
    color: #64748b;
    text-align: center;
}

.auth-admin-link a {
    color: #3b82f6;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.auth-admin-link a:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* ── 9. ALERT & NOTIFICATION STATES ──────────────────────────────────────── */
.auth-card .alert {
    border-radius: 10px;
    padding: 0.55rem 0.8rem;
    margin-top: 0.65rem;
    font-size: clamp(0.74rem, 1.6vw, 0.82rem);
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.auth-card .alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.auth-card .alert-error,
.auth-card .alert-danger {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

/* ==========================================================================
   EXPLICIT MOBILE CLEARANCES & FULL-PAGE NATURAL SCROLL
   (Guarantees comfortable breathing room on all smartphone screens)
   ========================================================================== */

@media (max-width: 768px) {
    .main-content.auth-main-layout {
        padding-top: 1.5rem !important;
        padding-bottom: 2rem !important;
    }

    .auth-container {
        padding: 0 !important;
    }

    .auth-card {
        margin-top: 0.25rem;
    }
}

@media (max-width: 480px) {
    .main-content.auth-main-layout {
        padding-top: 1.25rem !important;
        padding-bottom: 1.75rem !important;
    }

    .auth-container {
        padding: 0 !important;
    }

    .auth-card {
        margin-top: 0.25rem;
    }
}
