@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@300;400;500&display=swap');

/* ════════════════════════════
   ROOT & RESET
════════════════════════════ */
:root {
    --blue:   #2563eb;
    --cyan:   #0891b2;
    --purple: #7c3aed;
    --text:   #0f172a;
    --muted:  #64748b;
    --border: rgba(79,130,210,0.16);
    --bg:     #eef2ff;
}

.login-page *,
.login-page *::before,
.login-page *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ════════════════════════════
   FULL PAGE
════════════════════════════ */
.login-page {
    font-family: 'DM Sans', sans-serif;
    min-height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ── Deep ambient light blobs ── */
.login-page::before {
    content: '';
    position: fixed; inset: 0;
    background:
            radial-gradient(ellipse 80% 60% at 10% 10%,  rgba(37,99,235,0.18)  0%, transparent 55%),
            radial-gradient(ellipse 60% 50% at 90% 90%,  rgba(8,145,178,0.14)  0%, transparent 55%),
            radial-gradient(ellipse 50% 40% at 50% 50%,  rgba(124,58,237,0.08) 0%, transparent 50%),
            radial-gradient(ellipse 30% 30% at 80% 10%,  rgba(37,99,235,0.10)  0%, transparent 45%);
    pointer-events: none; z-index: 0;
    animation: blobPulse 8s ease-in-out infinite alternate;
}

@keyframes blobPulse {
    0%   { opacity: 0.8; }
    100% { opacity: 1; }
}

/* ── Drifting grid ── */
.login-page::after {
    content: '';
    position: fixed; inset: 0;
    background-image:
            linear-gradient(rgba(37,99,235,0.045) 1px, transparent 1px),
            linear-gradient(90deg, rgba(37,99,235,0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    pointer-events: none; z-index: 0;
    animation: gridDrift 25s linear infinite;
}

@keyframes gridDrift {
    to { background-position: 52px 52px, 52px 52px; }
}

/* ════════════════════════════
   FLOATING 3D ORBS — background deco
════════════════════════════ */
.login-deco {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
}

/* Big back orb */
.deco-orb1 {
    position: absolute;
    top: -120px; left: -120px;
    width: 420px; height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
    rgba(255,255,255,0.65) 0%,
    rgba(147,197,253,0.40) 35%,
    rgba(37,99,235,0.12)  70%,
    transparent 100%);
    box-shadow: inset -20px -16px 40px rgba(37,99,235,0.10);
    animation: decoFloat1 9s ease-in-out infinite;
}

/* Medium right orb */
.deco-orb2 {
    position: absolute;
    bottom: -80px; right: -80px;
    width: 320px; height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
    rgba(255,255,255,0.60) 0%,
    rgba(167,139,250,0.30) 35%,
    rgba(124,58,237,0.10)  70%,
    transparent 100%);
    box-shadow: inset -16px -12px 32px rgba(124,58,237,0.10);
    animation: decoFloat2 11s ease-in-out infinite;
}

/* Small top-right orb */
.deco-orb3 {
    position: absolute;
    top: 12%; right: 8%;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
    rgba(255,255,255,0.70) 0%,
    rgba(103,232,249,0.35) 45%,
    rgba(8,145,178,0.10)   70%,
    transparent 100%);
    box-shadow: inset -8px -6px 18px rgba(8,145,178,0.12);
    animation: decoFloat3 7s ease-in-out infinite;
}

/* Tiny bottom-left orb */
.deco-orb4 {
    position: absolute;
    bottom: 16%; left: 6%;
    width: 90px; height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 36%,
    rgba(255,255,255,0.70) 0%,
    rgba(196,181,253,0.40) 45%,
    rgba(124,58,237,0.12)  70%,
    transparent 100%);
    animation: decoFloat1 6s ease-in-out infinite reverse;
}

@keyframes decoFloat1 {
    0%,100% { transform: translate(0,0)     rotate(0deg);   }
    33%     { transform: translate(20px,-30px) rotate(5deg);  }
    66%     { transform: translate(-15px,20px) rotate(-4deg); }
}
@keyframes decoFloat2 {
    0%,100% { transform: translate(0,0)     rotate(0deg);   }
    40%     { transform: translate(-25px,-20px) rotate(-6deg);}
    70%     { transform: translate(18px,28px)  rotate(4deg); }
}
@keyframes decoFloat3 {
    0%,100% { transform: translate(0,0);    }
    50%     { transform: translate(-12px,18px); }
}

/* ── Floating text chips ── */
.deco-chip {
    position: absolute;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(79,130,210,0.18);
    border-radius: 100px;
    padding: 7px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--muted);
    display: flex; align-items: center; gap: 7px;
    box-shadow: 0 4px 18px rgba(37,99,235,0.10);
    pointer-events: none;
    white-space: nowrap;
}

.chip-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    animation: chipBlink 2s ease-in-out infinite;
}

@keyframes chipBlink {
    0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

.deco-chip1 {
    top: 14%; left: 5%;
    animation: chipFloat1 8s ease-in-out infinite;
}
.deco-chip2 {
    top: 28%; right: 4%;
    animation: chipFloat2 10s ease-in-out infinite;
}
.deco-chip3 {
    bottom: 22%; left: 4%;
    animation: chipFloat1 9s ease-in-out infinite reverse;
}
.deco-chip4 {
    bottom: 14%; right: 5%;
    animation: chipFloat2 7s ease-in-out infinite reverse;
}

@keyframes chipFloat1 {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(-14px); }
}
@keyframes chipFloat2 {
    0%,100% { transform: translateY(0); }
    50%     { transform: translateY(12px); }
}

/* ════════════════════════════
   CARD WRAPPER
════════════════════════════ */
.login-page .row {
    position: relative; z-index: 1;
}

.login-page .card {
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.90);
    border-radius: 28px !important;
    box-shadow:
            0 2px 0 rgba(255,255,255,0.95),
            0 12px 48px rgba(37,99,235,0.14),
            0 2px 8px  rgba(37,99,235,0.06);
    overflow: visible !important;
    animation: cardIn 0.8s cubic-bezier(.22,1,.36,1) both;
    position: relative;
}

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

/* Gradient top border */
.login-page .card::before {
    content: '';
    position: absolute;
    top: -1px; left: 24px; right: 24px;
    height: 3px;
    background: linear-gradient(90deg, var(--blue) 0%, var(--cyan) 50%, var(--purple) 100%);
    border-radius: 0 0 4px 4px;
    animation: borderFlow 4s ease infinite;
    background-size: 200% 100%;
}

@keyframes borderFlow {
    0%,100% { background-position: 0 0; }
    50%      { background-position: 100% 0; }
}

/* Subtle inner glow */
.login-page .card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 28px;
    background: linear-gradient(160deg, rgba(255,255,255,0.55) 0%, transparent 60%);
    pointer-events: none;
}

.login-page .card-body {
    padding: 44px 40px 38px !important;
    position: relative; z-index: 1;
}

/* ════════════════════════════
   HERO BRAND SECTION
════════════════════════════ */
.login-brand {
    text-align: center;
    margin-bottom: 34px;
    animation: fadeDown 0.7s 0.2s ease both;
}

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 3D Orb */
.login-orb-scene {
    display: flex; justify-content: center;
    margin-bottom: 18px;
    perspective: 600px;
}

.login-orb-c {
    position: relative;
    width: 88px; height: 88px;
    animation: orbFloat 4s ease-in-out infinite;
}

@keyframes orbFloat {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}

.login-orb-s {
    width: 76px; height: 76px;
    border-radius: 50%;
    position: absolute; top: 6px; left: 6px;
    background: linear-gradient(135deg,
    #dbeafe 0%, #bfdbfe 25%,
    #93c5fd 55%, #60a5fa 80%, #3b82f6 100%);
    box-shadow:
            inset -12px -9px 22px rgba(37,99,235,0.28),
            inset 9px 7px 22px  rgba(255,255,255,0.88),
            0 20px 56px rgba(37,99,235,0.28),
            0  6px 20px rgba(37,99,235,0.16);
    animation: orb3d 8s linear infinite, pulseGlow 3s ease-in-out infinite;
}

.login-orb-s::before {
    content: '';
    position: absolute;
    top: 12px; left: 15px;
    width: 28px; height: 18px;
    border-radius: 50%;
    background: rgba(255,255,255,0.76);
    filter: blur(3px);
    transform: rotate(-30deg);
}

@keyframes orb3d {
    0%   { transform: perspective(500px) rotateY(0deg)   rotateX(10deg) scale(1); }
    25%  { transform: perspective(500px) rotateY(90deg)  rotateX(-4deg) scale(1.04); }
    50%  { transform: perspective(500px) rotateY(180deg) rotateX(10deg) scale(1); }
    75%  { transform: perspective(500px) rotateY(270deg) rotateX(-4deg) scale(1.04); }
    100% { transform: perspective(500px) rotateY(360deg) rotateX(10deg) scale(1); }
}

@keyframes pulseGlow {
    0%,100% { box-shadow: 0 0 0 0 rgba(37,99,235,0.30), 0 20px 56px rgba(37,99,235,0.24); }
    50%      { box-shadow: 0 0 0 10px rgba(37,99,235,0.00), 0 20px 56px rgba(37,99,235,0.36); }
}

/* Orbital rings */
.login-orb-r1 {
    position: absolute; top: 50%; left: 50%;
    width: 82px; height: 82px;
    border-radius: 50%; margin: -41px;
    border: 2px solid rgba(37,99,235,0.28);
    border-top-color: transparent; border-bottom-color: transparent;
    animation: ringR1 6s linear infinite;
}

.login-orb-r2 {
    position: absolute; top: 50%; left: 50%;
    width: 94px; height: 94px;
    border-radius: 50%; margin: -47px;
    border: 1.5px solid rgba(8,145,178,0.20);
    border-left-color: transparent; border-right-color: transparent;
    animation: ringR1 9s linear infinite reverse;
}

@keyframes ringR1 {
    from { transform: translate(-50%,-50%) perspective(500px) rotateY(0deg)   rotateX(70deg); }
    to   { transform: translate(-50%,-50%) perspective(500px) rotateY(360deg) rotateX(70deg); }
}

/* Orbiting particles */
.login-orb-p {
    position: absolute; top: 50%; left: 50%;
    width: 9px; height: 9px; margin: -4.5px;
    border-radius: 50%;
}
.op1 {
    background: linear-gradient(135deg, #2563eb, #0891b2);
    box-shadow: 0 0 10px rgba(37,99,235,0.60);
    animation: ps1 4s linear infinite;
}
.op2 {
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    box-shadow: 0 0 10px rgba(124,58,237,0.60);
    animation: ps2 5.5s linear infinite;
}
.op3 {
    background: linear-gradient(135deg, #0891b2, #16a34a);
    box-shadow: 0 0 10px rgba(8,145,178,0.60);
    animation: ps3 7s linear infinite;
}

@keyframes ps1 { from{transform:rotate(0deg)   translateX(52px) rotate(0deg);}   to{transform:rotate(360deg)  translateX(52px) rotate(-360deg);} }
@keyframes ps2 { from{transform:rotate(120deg)  translateX(66px) rotate(-120deg);} to{transform:rotate(480deg)  translateX(66px) rotate(-480deg);} }
@keyframes ps3 { from{transform:rotate(240deg)  translateX(60px) rotate(-240deg);} to{transform:rotate(600deg)  translateX(60px) rotate(-600deg);} }

.login-orb-shd {
    position: absolute; bottom: -14px; left: 50%;
    transform: translateX(-50%);
    width: 60px; height: 12px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(37,99,235,0.22) 0%, transparent 70%);
}

/* Brand text */
.login-brand-name {
    font-family: 'Syne', sans-serif;
    font-size: 26px; font-weight: 800;
    background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1; margin-bottom: 6px;
}

.login-brand-tagline {
    font-size: 13px; color: var(--muted);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

.brand-pill {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.18);
    border-radius: 100px; padding: 3px 10px;
    font-size: 11.5px; color: var(--blue); font-weight: 500;
}

.brand-pill-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #16a34a;
    animation: chipBlink 2s infinite;
}

/* ════════════════════════════
   FORM HEADING
════════════════════════════ */
.login-page h4 {
    font-family: 'Syne', sans-serif;
    font-size: 17px; font-weight: 700;
    color: var(--text);
    text-align: center;
    margin-bottom: 24px;
    animation: fadeDown 0.6s 0.25s ease both;
}

/* ════════════════════════════
   FIELDS
════════════════════════════ */
.login-page .mb-3,
.login-page .form-group {
    margin-bottom: 16px !important;
}

.login-page label:not(.form-check-label) {
    font-size: 13px; font-weight: 500;
    color: #374151; margin-bottom: 6px;
    display: block;
}

.login-page .form-control {
    background: rgba(248,250,255,0.90);
    border: 1.5px solid rgba(79,130,210,0.18);
    border-radius: 13px !important;
    padding: 11px 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px; color: var(--text);
    transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
    box-shadow: 0 1px 3px rgba(37,99,235,0.05);
}

.login-page .form-control:focus {
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12), 0 1px 3px rgba(37,99,235,0.08);
    outline: none;
}

.login-page .form-control::placeholder { color: #94a3b8; }

/* ── Checkbox ── */
.login-page .custom-control,
.login-page .form-check {
    display: flex; align-items: center;
    gap: 9px; padding-left: 0;
    margin-bottom: 22px;
}

.login-page .custom-control-input,
.login-page .form-check-input {
    width: 18px; height: 18px;
    border: 1.5px solid rgba(79,130,210,0.30);
    border-radius: 6px !important;
    background: rgba(248,250,255,0.90);
    cursor: pointer; flex-shrink: 0; margin: 0;
    transition: border-color .2s, box-shadow .2s;
    appearance: none; -webkit-appearance: none;
    position: relative;
}

.login-page .custom-control-input:checked,
.login-page .form-check-input:checked {
    background-color: var(--bs-form-valid-color);
    border-color: var(--bs-form-valid-color);
    background-size: 72%; background-repeat: no-repeat; background-position: center;
}

.login-page .custom-control-input:focus,
.login-page .form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    border-color: var(--blue);
    outline: none;
}

.login-page .custom-control-label,
.login-page .form-check-label {
    font-size: 13.5px; color: var(--muted);
    cursor: pointer; user-select: none;
}

/* ════════════════════════════
   SUBMIT BUTTON
════════════════════════════ */
.login-page .btn-primary.sign-in,
.login-page .btn.btn-primary {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 9px;
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 40%, #0891b2 100%) !important;
    background-size: 200% 200% !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 13px 28px !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 15px !important; font-weight: 500 !important;
    color: #fff !important;
    position: relative; overflow: hidden;
    transition: transform 0.22s, box-shadow 0.22s !important;
    box-shadow:
            0 4px 24px rgba(37,99,235,0.42),
            0 1px 4px  rgba(37,99,235,0.20) !important;
    cursor: pointer;
    animation: gradShift 4s ease infinite;
    margin-bottom: 0 !important;
    letter-spacing: 0.01em;
}

@keyframes gradShift {
    0%,100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* Shimmer sweep */
.login-page .btn-primary.sign-in::before,
.login-page .btn.btn-primary::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 55%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.26), transparent);
    animation: shimmer 3s 1.8s ease infinite;
}

@keyframes shimmer {
    0%       { left: -100%; }
    60%,100% { left: 160%; }
}

/* Ring pulse */
.login-page .btn-primary.sign-in::after,
.login-page .btn.btn-primary::after {
    content: '';
    position: absolute; inset: -3px;
    border-radius: 17px;
    border: 2px solid rgba(37,99,235,0.45);
    animation: ringPulse 2.5s ease-in-out infinite;
}

@keyframes ringPulse {
    0%,100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 1; transform: scale(1.03); }
}

.login-page .btn-primary.sign-in:hover,
.login-page .btn.btn-primary:hover {
    transform: translateY(-3px) scale(1.015) !important;
    box-shadow:
            0 10px 40px rgba(37,99,235,0.52),
            0 2px 8px  rgba(37,99,235,0.24) !important;
    color: #fff !important;
    text-decoration: none;
}

.login-page .btn-primary.sign-in:active,
.login-page .btn.btn-primary:active {
    transform: translateY(0) scale(0.99) !important;
}

/* ════════════════════════════
   VALIDATION
════════════════════════════ */
.login-page .invalid-feedback,
.login-page .help-block {
    font-size: 12px; color: #dc2626; margin-top: 5px;
}

.login-page .form-control.is-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.10) !important;
}

/* ════════════════════════════
   FOOTER
════════════════════════════ */
.login-footer {
    margin-top: 24px; text-align: center;
    animation: fadeDown 0.6s 0.5s ease both;
}

.login-footer-chips {
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    flex-wrap: wrap;
}

.lf-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(37,99,235,0.06);
    border: 1px solid rgba(37,99,235,0.14);
    border-radius: 100px; padding: 4px 11px;
    font-size: 11.5px; color: var(--muted); font-weight: 500;
}

.lf-chip-ico {
    width: 7px; height: 7px;
    border-radius: 50%;
}

/* ════════════════════════════
   FOOTER
════════════════════════════ */
.login-footer {
    margin-top: 24px; text-align: center;
    animation: fadeDown 0.6s 0.5s ease both;
}

.login-footer-chips {
    display: flex; align-items: center;
    justify-content: center; gap: 8px;
    flex-wrap: wrap;
}

.lf-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(37,99,235,0.06);
    border: 1px solid rgba(37,99,235,0.14);
    border-radius: 100px; padding: 4px 11px;
    font-size: 11.5px; color: var(--muted); font-weight: 500;
}

.lf-chip-ico {
    width: 7px; height: 7px;
    border-radius: 50%;
}

/* ── Footer nav buttons ── */
.login-footer-btns {
    display: flex; gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
}

.lf-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px;
    border-radius: 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13.5px; font-weight: 500;
    text-decoration: none !important;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
    cursor: pointer;
}

.lf-btn svg {
    width: 15px; height: 15px; flex-shrink: 0;
    transition: transform 0.2s;
}

/* Back button — outline style */
.lf-btn-back {
    background: rgba(255,255,255,0.80);
    border: 1.5px solid rgba(79,130,210,0.22);
    color: var(--muted) !important;
    box-shadow: 0 2px 8px rgba(37,99,235,0.07);
}

.lf-btn-back:hover {
    background: rgba(37,99,235,0.07);
    border-color: rgba(37,99,235,0.35);
    color: var(--blue) !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 14px rgba(37,99,235,0.12);
}

.lf-btn-back:hover svg { transform: translateX(-3px); }

/* Home button — filled subtle */
.lf-btn-home {
    background: linear-gradient(135deg, rgba(37,99,235,0.10) 0%, rgba(8,145,178,0.10) 100%);
    border: 1.5px solid rgba(37,99,235,0.22);
    color: var(--blue) !important;
    box-shadow: 0 2px 8px rgba(37,99,235,0.09);
}

.lf-btn-home:hover {
    background: linear-gradient(135deg, rgba(37,99,235,0.16) 0%, rgba(8,145,178,0.16) 100%);
    border-color: rgba(37,99,235,0.42);
    color: var(--blue) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.18);
}

.lf-btn-home:hover svg { transform: scale(1.15); }