/* ============================================
   Uptrix — Login Page (refined)
   ============================================ */

body.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background: #0b1220;
}

body.login-page .main-content {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
    position: relative;
    z-index: 1;
}

body.login-page .main-content > .flash-messages {
    position: relative;
    z-index: 5;
    flex-shrink: 0;
    padding: 0.75rem 1rem 0;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
}

body.login-page .main-content > .container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-height: 0;
    padding: 0 !important;
    margin: 0;
}

/* ---- Layout ---- */

.login-page-layout {
    display: grid;
    grid-template-columns: minmax(300px, 1.08fr) minmax(340px, 0.92fr);
    min-height: 100vh;
    width: 100%;
}

/* ---- Brand panel ---- */

.login-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    overflow: hidden;
    background: #0a0f1a;
    isolation: isolate;
}

/* ---- Live animated wallpaper (left panel) ---- */

.login-brand-wallpaper {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.login-brand-wallpaper__base {
    position: absolute;
    inset: 0;
    background: linear-gradient(165deg, #070b14 0%, #0f172a 45%, #121a2e 100%);
}

.login-brand-wallpaper__aurora {
    position: absolute;
    width: 140%;
    height: 140%;
    top: -20%;
    left: -20%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        rgba(219, 39, 119, 0.22) 0deg,
        rgba(249, 115, 22, 0.14) 72deg,
        rgba(20, 184, 166, 0.18) 144deg,
        rgba(59, 130, 246, 0.2) 216deg,
        rgba(124, 58, 237, 0.22) 288deg,
        rgba(219, 39, 119, 0.22) 360deg
    );
    filter: blur(48px);
    opacity: 0.65;
    animation: loginAuroraSpin 32s linear infinite;
}

@keyframes loginAuroraSpin {
    from { transform: rotate(0deg) scale(1); }
    to { transform: rotate(360deg) scale(1); }
}

.login-brand-wallpaper__mesh {
    position: absolute;
    inset: -30%;
    background:
        radial-gradient(ellipse 55% 45% at 20% 30%, rgba(219, 39, 119, 0.35), transparent 70%),
        radial-gradient(ellipse 50% 40% at 75% 25%, rgba(59, 130, 246, 0.32), transparent 68%),
        radial-gradient(ellipse 45% 50% at 40% 80%, rgba(20, 184, 166, 0.28), transparent 72%),
        radial-gradient(ellipse 40% 35% at 85% 70%, rgba(124, 58, 237, 0.3), transparent 70%);
    animation: loginMeshFlow 18s ease-in-out infinite;
}

@keyframes loginMeshFlow {
    0%, 100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.85;
    }
    33% {
        transform: translate(4%, -3%) scale(1.08) rotate(2deg);
        opacity: 1;
    }
    66% {
        transform: translate(-3%, 4%) scale(0.96) rotate(-1deg);
        opacity: 0.9;
    }
}

.login-brand-wallpaper__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(64px);
    mix-blend-mode: screen;
    will-change: transform;
}

.login-brand-wallpaper__blob--magenta {
    width: min(42vw, 320px);
    height: min(42vw, 320px);
    background: radial-gradient(circle, rgba(236, 72, 153, 0.85) 0%, rgba(219, 39, 119, 0.4) 45%, transparent 70%);
    top: -8%;
    left: -12%;
    animation: loginBlobMagenta 22s ease-in-out infinite;
}

.login-brand-wallpaper__blob--orange {
    width: min(36vw, 260px);
    height: min(36vw, 260px);
    background: radial-gradient(circle, rgba(251, 146, 60, 0.8) 0%, rgba(249, 115, 22, 0.35) 50%, transparent 72%);
    bottom: 8%;
    left: 5%;
    animation: loginBlobOrange 26s ease-in-out infinite;
}

.login-brand-wallpaper__blob--teal {
    width: min(38vw, 280px);
    height: min(38vw, 280px);
    background: radial-gradient(circle, rgba(45, 212, 191, 0.75) 0%, rgba(20, 184, 166, 0.35) 48%, transparent 70%);
    top: 42%;
    right: -15%;
    animation: loginBlobTeal 20s ease-in-out infinite;
}

.login-brand-wallpaper__blob--blue {
    width: min(48vw, 360px);
    height: min(48vw, 360px);
    background: radial-gradient(circle, rgba(96, 165, 250, 0.7) 0%, rgba(37, 99, 235, 0.32) 50%, transparent 72%);
    bottom: -18%;
    right: -5%;
    animation: loginBlobBlue 28s ease-in-out infinite;
}

.login-brand-wallpaper__blob--purple {
    width: min(32vw, 240px);
    height: min(32vw, 240px);
    background: radial-gradient(circle, rgba(167, 139, 250, 0.8) 0%, rgba(124, 58, 237, 0.38) 48%, transparent 70%);
    top: 18%;
    right: 12%;
    animation: loginBlobPurple 24s ease-in-out infinite;
}

@keyframes loginBlobMagenta {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(12%, 8%) scale(1.12); }
    50% { transform: translate(6%, 18%) scale(0.92); }
    75% { transform: translate(-8%, 6%) scale(1.06); }
}

@keyframes loginBlobOrange {
    0%, 100% { transform: translate(0, 0) scale(1); }
    30% { transform: translate(15%, -10%) scale(1.1); }
    60% { transform: translate(-10%, -5%) scale(0.95); }
    85% { transform: translate(5%, 12%) scale(1.08); }
}

@keyframes loginBlobTeal {
    0%, 100% { transform: translate(0, 0) scale(1); }
    20% { transform: translate(-12%, 6%) scale(1.08); }
    45% { transform: translate(8%, -12%) scale(1.14); }
    70% { transform: translate(14%, 8%) scale(0.9); }
}

@keyframes loginBlobBlue {
    0%, 100% { transform: translate(0, 0) scale(1); }
    35% { transform: translate(-8%, -14%) scale(1.1); }
    55% { transform: translate(10%, -6%) scale(0.94); }
    80% { transform: translate(-6%, 10%) scale(1.06); }
}

@keyframes loginBlobPurple {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(-14%, 10%) scale(1.12); }
    65% { transform: translate(10%, 14%) scale(0.88); }
    90% { transform: translate(6%, -8%) scale(1.04); }
}

.login-brand-wallpaper__shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 0%,
        transparent 38%,
        rgba(255, 255, 255, 0.04) 48%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(255, 255, 255, 0.04) 52%,
        transparent 62%,
        transparent 100%
    );
    background-size: 220% 100%;
    animation: loginShimmerSweep 9s ease-in-out infinite;
}

@keyframes loginShimmerSweep {
    0% { background-position: 220% 0; }
    100% { background-position: -220% 0; }
}

.login-brand-wallpaper__grid {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 32px 32px;
    animation: loginGridDrift 40s linear infinite;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, black 20%, transparent 75%);
}

@keyframes loginGridDrift {
    from { background-position: 0 0; }
    to { background-position: 32px 32px; }
}

.login-brand-wallpaper__vignette {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 80% at 50% 50%, transparent 35%, rgba(7, 11, 20, 0.55) 100%),
        linear-gradient(180deg, rgba(7, 11, 20, 0.35) 0%, transparent 25%, transparent 75%, rgba(7, 11, 20, 0.5) 100%);
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .login-brand-wallpaper__aurora,
    .login-brand-wallpaper__mesh,
    .login-brand-wallpaper__blob,
    .login-brand-wallpaper__shimmer,
    .login-brand-wallpaper__grid {
        animation: none !important;
    }
}

.login-brand-panel__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
}

/* Logo showcase */
.login-brand-logo-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.75rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.12);
    animation: loginLogoIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.login-brand-logo-card__ring {
    position: absolute;
    inset: -1px;
    border-radius: 25px;
    padding: 1px;
    background: linear-gradient(
        135deg,
        rgba(219, 39, 119, 0.5),
        rgba(249, 115, 22, 0.45),
        rgba(20, 184, 166, 0.5),
        rgba(59, 130, 246, 0.5),
        rgba(124, 58, 237, 0.5)
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes loginLogoIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
}

.login-brand-headline {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

.login-brand-headline__accent {
    display: block;
    background: linear-gradient(90deg, #5eead4, #93c5fd, #c4b5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.login-brand-desc {
    margin: 0 0 1.75rem;
    font-size: 0.9375rem;
    color: rgba(203, 213, 225, 0.85);
    line-height: 1.55;
    font-weight: 450;
}

/* Feature list */
.login-brand-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.login-brand-features__item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.login-brand-features__item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.login-brand-features__item--1 { border-left: 3px solid #f472b6; }
.login-brand-features__item--2 { border-left: 3px solid #38bdf8; }
.login-brand-features__item--3 { border-left: 3px solid #34d399; }

.login-brand-features__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.08);
}

.login-brand-features__item--1 .login-brand-features__icon { color: #f9a8d4; }
.login-brand-features__item--2 .login-brand-features__icon { color: #7dd3fc; }
.login-brand-features__item--3 .login-brand-features__icon { color: #6ee7b7; }

.login-brand-features__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.login-brand-features__text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
}

.login-brand-features__text small {
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.95);
    line-height: 1.35;
}

/* ---- Form panel ---- */

.login-form-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #f4f7fb;
    overflow: hidden;
}

.login-form-panel__pattern {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(13, 148, 136, 0.07), transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(37, 99, 235, 0.06), transparent 42%),
        linear-gradient(180deg, #fafbfd 0%, #f1f5f9 100%);
    pointer-events: none;
}

.login-form-panel__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    animation: loginFormIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

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

.login-card {
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 20px 50px rgba(15, 23, 42, 0.08),
        0 40px 80px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.login-card__accent {
    height: 3px;
    background: linear-gradient(
        90deg,
        #db2777,
        #f97316,
        #14b8a6,
        #3b82f6,
        #7c3aed
    );
}

.login-card__body {
    padding: 2.5rem 2.25rem 2rem;
}

/* Form header */
.login-form-header {
    margin-bottom: 2rem;
}

.login-form-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f766e;
    background: #f0fdfa;
    border: 1px solid #99f6e4;
    border-radius: 999px;
}

.login-form-badge i {
    font-size: 0.85rem;
}

.login-form-title {
    margin: 0 0 0.4rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.login-form-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: #64748b;
    line-height: 1.5;
}

/* Fields */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.login-field {
    margin-bottom: 1.25rem;
}

.login-field:last-of-type {
    margin-bottom: 1.5rem;
}

.login-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    letter-spacing: 0.01em;
}

.login-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.login-input-group__icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    color: #94a3b8;
    font-size: 1rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.login-input-group:focus-within .login-input-group__icon {
    color: #0d9488;
}

.login-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.65rem;
    font-size: 0.9375rem;
    color: #0f172a;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fafbfc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.login-input:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.login-input:focus {
    border-color: #0d9488;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
    outline: none;
}

.login-input-group--password .login-input {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #94a3b8;
    cursor: pointer;
    z-index: 3;
    transition: color 0.2s ease, background 0.2s ease;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
    color: #0d9488;
    background: rgba(13, 148, 136, 0.08);
    outline: none;
}

.login-field-error {
    margin-top: 0.4rem;
    font-size: 0.8125rem;
    color: #e11d48;
    font-weight: 500;
}

.login-input.is-invalid {
    border-color: #fda4af;
    background: #fffbfb;
}

.login-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.12);
}

/* Submit */
.login-submit-btn {
    position: relative;
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem;
    font-weight: 600;
    color: #fff !important;
    border: none !important;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d9488 0%, #1d6fd8 52%, #6d28d9 100%) !important;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2) inset,
        0 10px 24px rgba(13, 148, 136, 0.25);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-submit-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, transparent 48%);
    pointer-events: none;
}

.login-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.22) inset,
        0 14px 32px rgba(37, 99, 235, 0.28);
}

.login-submit-btn:active {
    transform: translateY(0);
}

.login-submit-btn__label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.login-trust-note {
    margin: 1.25rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.login-trust-note i {
    font-size: 0.7rem;
    color: #cbd5e1;
}

.login-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.login-footer span {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Stagger */
.login-form .login-field {
    animation: loginFieldIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-form .login-field:nth-child(1) { animation-delay: 0.25s; }
.login-form .login-field:nth-child(2) { animation-delay: 0.32s; }
.login-submit-btn { animation: loginFieldIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.4s both; }
.login-trust-note { animation: loginFieldIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.48s both; }

@keyframes loginFieldIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */

@media (max-width: 991.98px) {
    .login-page-layout {
        grid-template-columns: 1fr;
    }

    .login-brand-panel {
        padding: 2.25rem 1.5rem 1.75rem;
    }

    .login-brand-panel__inner {
        max-width: 400px;
        margin: 0 auto;
        text-align: center;
    }

    .login-brand-logo-card {
        margin-bottom: 1.5rem;
        padding: 1.5rem 1.25rem;
    }

    .login-brand-logo {
        max-width: 220px;
        margin: 0 auto;
    }

    .login-brand-headline {
        font-size: 1.4rem;
    }

    .login-brand-desc {
        margin-bottom: 1.25rem;
    }

    .login-brand-features__item:hover {
        transform: none;
    }

    .login-form-panel {
        padding: 2rem 1.25rem 2.5rem;
    }
}

@media (max-width: 575.98px) {
    .login-brand-panel {
        padding: 1.75rem 1rem 1.5rem;
    }

    .login-card__body {
        padding: 2rem 1.35rem 1.75rem;
    }

    .login-form-title {
        font-size: 1.5rem;
    }
}
