/* ============================================================
   Project CRM – Auth Pages (Login / Register / Password Reset)
   Theme: Next-Gen Deep Cosmic Dark Glassmorphism
   Fonts: Outfit + Inter
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
    --auth-bg:           #070a1e;
    --auth-bg-left:      #090d28;
    --auth-card:         rgba(15, 23, 42, 0.88);
    --auth-card-hover:   rgba(20, 30, 58, 0.95);
    --auth-border:       rgba(255, 255, 255, 0.12);
    --auth-primary:      #6366f1;
    --auth-accent:       #a855f7;
    --auth-pink:         #ec4899;
    --auth-text:         #f8fafc;
    --auth-muted:        #94a3b8;
    --auth-input-bg:     rgba(255, 255, 255, 0.05);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-input-focus:  rgba(99, 102, 241, 0.5);
    --radius-sm:         10px;
    --radius-md:         14px;
    --radius-lg:         22px;
    --radius-pill:       9999px;
    --transition:        all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: var(--auth-bg) !important;
    color: var(--auth-text) !important;
    font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Background & Ambient Glow ───────────────────────────── */
.auth-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 10% 10%, rgba(99, 102, 241, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 65% 55% at 90% 10%, rgba(168, 85, 247, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 80% 90%, rgba(236, 72, 153, 0.2) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 20% 85%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        #070a1e;
    pointer-events: none;
    z-index: 0;
}

.auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
    animation: orbFloat 14s ease-in-out infinite;
}

.auth-orb-1 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
    top: -160px;
    left: -160px;
    animation-delay: 0s;
}

.auth-orb-2 {
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.25) 0%, transparent 70%);
    bottom: -140px;
    right: -140px;
    animation-delay: -7s;
}

.auth-orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, transparent 70%);
    top: 45%;
    left: 55%;
    animation-delay: -3.5s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(25px, -35px) scale(1.06); }
    66%      { transform: translate(-20px, 25px) scale(0.96); }
}

/* ── Split Screen Wrapper ────────────────────────────────── */
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: transparent;
}

/* ── LEFT PANEL (Branding & Feature Showcase) ────────────── */
.auth-panel-left {
    flex: 1.15;
    background:
        radial-gradient(ellipse 85% 65% at 20% 15%, rgba(99, 102, 241, 0.32) 0%, transparent 65%),
        radial-gradient(ellipse 75% 65% at 85% 85%, rgba(236, 72, 153, 0.24) 0%, transparent 65%),
        radial-gradient(ellipse 65% 55% at 50% 50%, rgba(168, 85, 247, 0.18) 0%, transparent 60%),
        #0a0f2c !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4rem 4.5rem;
    position: relative;
    overflow: hidden;
}

.auth-panel-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='1.5'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

/* Left Brand Header */
.panel-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    margin-bottom: 2.5rem;
    align-self: flex-start;
    transition: var(--transition);
}

.panel-brand:hover {
    transform: translateY(-2px);
}

.panel-brand-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #ffffff !important;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
    flex-shrink: 0;
}

.panel-brand-text {
    font-size: 1.65rem;
    font-weight: 900;
    color: #ffffff !important;
    letter-spacing: -0.5px;
}

.panel-brand-text span {
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Left Center Content */
.panel-center-content {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
}

.panel-tagline {
    font-size: clamp(2.2rem, 3.2vw, 3rem);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -1.2px;
    color: #ffffff !important;
    margin-bottom: 1.15rem;
    text-align: left;
}

.panel-tagline .highlight {
    background: linear-gradient(135deg, #c7d2fe 0%, #c084fc 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.panel-subtitle {
    font-size: 1.05rem;
    color: #cbd5e1 !important;
    text-align: left;
    line-height: 1.7;
    margin-bottom: 2.25rem;
    font-weight: 400;
}

/* Left Feature List (Frosted Cards) */
.panel-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    width: 100%;
}

.panel-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #f1f5f9 !important;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    transition: var(--transition);
}

.panel-features li:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.35);
    transform: translateX(4px);
}

.pf-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.pf-i1 { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; border: 1px solid rgba(99, 102, 241, 0.35); }
.pf-i2 { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.35); }
.pf-i3 { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.35); }
.pf-i4 { background: rgba(6, 182, 212, 0.2);  color: #22d3ee; border: 1px solid rgba(6, 182, 212, 0.35); }

/* Left Bottom Stats Container */
.panel-stats {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.75rem;
    backdrop-filter: blur(16px);
}

.ps-item {
    text-align: center;
    flex: 1;
}

.ps-num {
    font-size: 1.65rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 40%, #c7d2fe 80%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.ps-lbl {
    font-size: 0.78rem;
    color: #94a3b8 !important;
    margin-top: 4px;
    font-weight: 600;
}

/* ── RIGHT PANEL (Auth Form Container) ───────────────────── */
.auth-panel-right {
    width: 540px;
    max-width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    background:
        radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 65%),
        #070a1e !important;
    position: relative;
}

.auth-form-box {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 2;
}

/* ── AUTH CARD (Frosted Glassmorphism) ───────────────────── */
.auth-card {
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 24px !important;
    padding: 2.75rem 2.25rem !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 30px 70px rgba(0, 0, 0, 0.7),
        0 0 90px rgba(99, 102, 241, 0.16) !important;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    border-radius: 24px 24px 0 0;
}

/* Card Header */
.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-card-icon {
    width: 62px;
    height: 62px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    color: #ffffff !important;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 35px rgba(99, 102, 241, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-card-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0 0 0.45rem;
    letter-spacing: -0.5px;
}

.auth-card-subtitle {
    font-size: 0.92rem;
    color: var(--auth-muted) !important;
    margin: 0;
    line-height: 1.5;
}

/* ── Form Controls & Inputs ──────────────────────────────── */
.form-group-fancy {
    margin-bottom: 1.35rem;
    position: relative;
}

.form-label-fancy {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1 !important;
    margin-bottom: 0.55rem;
}

.form-label-fancy i {
    color: #818cf8;
    font-size: 0.82rem;
}

.form-control-fancy {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 12px !important;
    padding: 13px 16px !important;
    font-size: 0.95rem !important;
    font-family: 'Outfit', sans-serif !important;
    color: #ffffff !important;
    transition: var(--transition) !important;
    box-shadow: none !important;
    outline: none !important;
}

.form-control-fancy::placeholder {
    color: rgba(148, 163, 184, 0.5) !important;
}

.form-control-fancy:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* Chrome / Edge / Safari Autofill Dark Override */
.form-control-fancy:-webkit-autofill,
.form-control-fancy:-webkit-autofill:hover,
.form-control-fancy:-webkit-autofill:focus,
.form-control-fancy:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #131b38 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(99, 102, 241, 0.5) !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

/* Password Toggle Button */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .form-control-fancy {
    padding-right: 48px !important;
}

.input-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer;
    padding: 4px;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    box-shadow: none !important;
    outline: none !important;
}

.input-toggle-btn:hover {
    color: #c7d2fe !important;
}

/* ── Checkbox & Forgot Password ──────────────────────────── */
.fancy-check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.fancy-check-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 19px;
    height: 19px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
}

.fancy-check-wrap input[type="checkbox"]:checked {
    background: var(--auth-primary) !important;
    border-color: var(--auth-primary) !important;
}

.fancy-check-wrap input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #ffffff;
    font-weight: 900;
}

.fancy-check-label {
    font-size: 0.88rem;
    color: var(--auth-muted) !important;
    cursor: pointer;
}

.auth-forgot-link {
    font-size: 0.85rem;
    color: #a5b4fc !important;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.auth-forgot-link:hover {
    color: #c7d2fe !important;
    text-decoration: underline;
}

/* ── Primary Submit Button ───────────────────────────────── */
.btn-auth-primary {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent)) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 14px 24px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    font-family: 'Outfit', sans-serif !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    margin-top: 1.75rem !important;
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45) !important;
    letter-spacing: 0.2px !important;
    text-decoration: none !important;
}

.btn-auth-primary:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 35px rgba(99, 102, 241, 0.65) !important;
    color: #ffffff !important;
}

.btn-auth-primary:active {
    transform: translateY(0) !important;
}

/* ── Error & Status Messages ─────────────────────────────── */
.auth-status {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.auth-error {
    color: #f87171;
    font-size: 0.82rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

/* ── Password Strength Meter (Register Page) ─────────────── */
.strength-meter {
    display: flex;
    gap: 6px;
    height: 4px;
}

.sm-bar {
    flex: 1;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    transition: background 0.3s ease;
}

.active-weak   { background: #ef4444 !important; }
.active-fair   { background: #f59e0b !important; }
.active-good   { background: #10b981 !important; }
.active-strong { background: #22d3ee !important; }

/* ── Footer Meta Links ───────────────────────────────────── */
.auth-footer-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-footer-link a {
    color: #c084fc !important;
    text-decoration: none;
    font-weight: 600;
    margin-left: 4px;
    transition: var(--transition);
}

.auth-footer-link a:hover {
    color: #e879f9 !important;
    text-decoration: underline;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #94a3b8 !important;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-back-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ── Responsive Layout ───────────────────────────────────── */
@media (max-width: 1024px) {
    .auth-panel-left {
        padding: 3rem 2.5rem;
    }
}

@media (max-width: 900px) {
    .auth-wrapper {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem 1rem;
    }

    .auth-panel-left {
        display: none;
    }

    .auth-panel-right {
        width: 100%;
        max-width: 480px;
        padding: 1rem 0;
        background: transparent !important;
    }

    .auth-card {
        padding: 2.25rem 1.75rem !important;
    }
}
