/* ============================================================
   Project CRM – Auth Pages (Login / Register / etc.) Styles
   ============================================================ */

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

/* ── Variables ───────────────────────────────────────────── */
:root {
    --auth-bg:       #050816;
    --auth-card:     rgba(10, 16, 38, 0.82);
    --auth-border:   rgba(255, 255, 255, 0.08);
    --auth-primary:  #6366f1;
    --auth-accent:   #a855f7;
    --auth-pink:     #ec4899;
    --auth-text:     #f1f5f9;
    --auth-muted:    #94a3b8;
    --auth-input-bg: rgba(255, 255, 255, 0.04);
    --auth-input-border: rgba(255, 255, 255, 0.1);
    --auth-input-focus:  rgba(99, 102, 241, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ── Body ────────────────────────────────────────────────── */
body {
    font-family: 'Outfit', 'Inter', sans-serif;
    background-color: var(--auth-bg);
    color: var(--auth-text);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    position: relative;
}

/* ── Animated background ─────────────────────────────────── */
.auth-bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 10% -10%, rgba(99,102,241,.28) 0%, transparent 55%),
        radial-gradient(ellipse 60% 50% at 90% 0%, rgba(168,85,247,.22) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 85% 95%, rgba(236,72,153,.16) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 5% 95%, rgba(34,211,238,.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

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

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

.auth-orb-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(34,211,238,.12) 0%, transparent 70%);
    top: 50%;
    left: 60%;
    animation-delay: -3s;
}

@keyframes orbFloat {
    0%,100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.05); }
    66% { transform: translate(-15px, 20px) scale(0.97); }
}

/* ── Auth Layout ─────────────────────────────────────────── */
.auth-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}

/* Left Panel (branding) */
.auth-panel-left {
    flex: 1;
    background: linear-gradient(135deg,
        rgba(99,102,241,.18) 0%,
        rgba(168,85,247,.14) 40%,
        rgba(236,72,153,.12) 100%);
    border-right: 1px solid var(--auth-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 4rem;
    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.02'%3E%3Ccircle cx='30' cy='30' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.panel-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 3rem;
}

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

.panel-brand-text {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
}

.panel-tagline {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -1px;
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
}

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

.panel-subtitle {
    font-size: 1rem;
    color: var(--auth-muted);
    text-align: center;
    line-height: 1.65;
    margin-bottom: 3rem;
    max-width: 380px;
}

/* Feature bullets on left panel */
.panel-features {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 380px;
}

.panel-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    font-size: 0.92rem;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.panel-features li:last-child { border-bottom: none; }

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

.pf-i1 { background: rgba(99,102,241,.15); color: #818cf8; }
.pf-i2 { background: rgba(168,85,247,.15); color: #c084fc; }
.pf-i3 { background: rgba(236,72,153,.15); color: #f472b6; }
.pf-i4 { background: rgba(34,211,238,.15); color: #22d3ee; }

/* Panel decorative elements */
.panel-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,.08);
    width: 100%;
    max-width: 380px;
}

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

.ps-num {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.ps-lbl {
    font-size: 0.75rem;
    color: var(--auth-muted);
    margin-top: 4px;
}

/* Right panel (form) */
.auth-panel-right {
    width: 480px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-form-box {
    width: 100%;
    max-width: 420px;
}

/* ── Auth Card ───────────────────────────────────────────── */
.auth-card {
    background: var(--auth-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow:
        0 0 0 1px rgba(255,255,255,.03),
        0 25px 60px rgba(0,0,0,.6),
        0 0 80px rgba(99,102,241,.08);
    position: relative;
    overflow: hidden;
    animation: authCardIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes authCardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--auth-primary), var(--auth-accent), var(--auth-pink));
    border-radius: 24px 24px 0 0;
}

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

.auth-card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
    margin: 0 auto 1rem;
    box-shadow: 0 0 30px rgba(99,102,241,.4);
}

.auth-card-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.4rem;
    letter-spacing: -0.5px;
}

.auth-card-subtitle {
    font-size: 0.88rem;
    color: var(--auth-muted);
    margin: 0;
}

/* ── Form Elements ───────────────────────────────────────── */
.form-group-fancy {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-label-fancy {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

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

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

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

.form-control-fancy:focus {
    border-color: var(--auth-primary) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.2) !important;
    background: rgba(255,255,255,.06) !important;
}

/* Password toggle wrapper */
.input-icon-wrap {
    position: relative;
}

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

.input-toggle-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-muted);
    cursor: pointer;
    padding: 0;
    width: auto !important;
    margin: 0 !important;
    font-size: 0.9rem;
    transition: color 0.25s;
    box-shadow: none !important;
}

.input-toggle-btn:hover {
    color: #818cf8;
    transform: translateY(-50%) !important;
    box-shadow: none !important;
    background: none !important;
}

/* ── Checkbox ────────────────────────────────────────────── */
.fancy-check-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.fancy-check-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--auth-input-border);
    border-radius: 5px;
    background: var(--auth-input-bg);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
}

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

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

.fancy-check-label {
    font-size: 0.85rem;
    color: var(--auth-muted);
    cursor: pointer;
    user-select: none;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-auth-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-accent));
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 24px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1.5rem;
    box-shadow: 0 5px 20px rgba(99,102,241,.35);
    letter-spacing: 0.3px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-auth-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.12), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-auth-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99,102,241,.5);
    color: #fff;
}

.btn-auth-primary:hover::before { opacity: 1; }

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

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

.auth-footer-link a {
    color: #818cf8;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.25s;
}

.auth-footer-link a:hover { color: #a5b4fc; }

.auth-forgot-link {
    font-size: 0.82rem;
    color: var(--auth-muted);
    text-decoration: none;
    transition: color 0.25s;
}

.auth-forgot-link:hover { color: #818cf8; }

/* ── Error Messages ──────────────────────────────────────── */
.auth-error {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(239,68,68,.1);
    border: 1px solid rgba(239,68,68,.25);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 0.82rem;
    color: #fca5a5;
}

.auth-error i { font-size: 0.75rem; }

/* ── Session Status ──────────────────────────────────────── */
.auth-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(34,197,94,.1);
    border: 1px solid rgba(34,197,94,.25);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    color: #86efac;
}

/* ── Divider ─────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
}

.auth-divider-line {
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

.auth-divider-text {
    font-size: 0.78rem;
    color: var(--auth-muted);
    white-space: nowrap;
}

/* ── OAuth / Social ──────────────────────────────────────── */
.social-auth-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font-size: 0.85rem;
    color: var(--auth-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.btn-social:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.15);
    color: #fff;
    transform: translateY(-1px);
}

/* Strength meter */
.strength-meter {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.sm-bar {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,.08);
    border-radius: 2px;
    transition: background 0.3s;
}

.sm-bar.active-weak   { background: #ef4444; }
.sm-bar.active-fair   { background: #f59e0b; }
.sm-bar.active-good   { background: #22c55e; }
.sm-bar.active-strong { background: #22d3ee; }

/* Responsive – hide left panel below lg */
@media (max-width: 991px) {
    .auth-panel-left { display: none; }
    .auth-panel-right {
        width: 100%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-card { padding: 2rem 1.5rem; }
    .auth-card-title { font-size: 1.4rem; }
    .social-auth-btns { grid-template-columns: 1fr; }
}
