﻿:root {
    --bg-main: #f4f7fb;
    --bg-card: rgba(255,255,255,0.88);
    --bg-card-solid: #ffffff;
    --text-main: #111827;
    --text-soft: #6b7280;
    --text-muted: #94a3b8;
    --border: rgba(148,163,184,0.25);
    --input-bg: rgba(255,255,255,0.95);
    --input-border: #dbe3ee;
    --shadow-lg: 0 24px 80px rgba(15,23,42,0.18);
    --shadow-sm: 0 8px 24px rgba(15,23,42,0.08);
    --primary: #0b4f6c;
    --primary-hover: #0b4f6c;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #b91c1c;
    --glass: saturate(180%) blur(18px);
    --brand-panel-bg: linear-gradient(180deg, rgba(11, 79, 108, 1), rgba(11, 79, 108, 1));
    --theme-btn-bg: rgba(255,255,255,0.8);
    --theme-btn-text: #111827;
}

html[data-theme="dark"] {
    --bg-main: #08111f;
    --bg-card: rgba(7,18,35,0.74);
    --bg-card-solid: #0f172a;
    --text-main: #e5eefc;
    --text-soft: #9fb0c8;
    --text-muted: #7c8ca5;
    --border: rgba(148,163,184,0.18);
    --input-bg: rgba(15,23,42,0.88);
    --input-border: rgba(148,163,184,0.18);
    --shadow-lg: 0 24px 80px rgba(0,0,0,0.45);
    --shadow-sm: 0 10px 30px rgba(0,0,0,0.25);
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --danger-bg: rgba(127,29,29,0.30);
    --danger-border: rgba(248,113,113,0.25);
    --danger-text: #fecaca;
    --brand-panel-bg: linear-gradient(180deg, rgba(30,64,175,0.85), rgba(30,41,59,0.92));
    --theme-btn-bg: rgba(15,23,42,0.92);
    --theme-btn-text: #e5eefc;
}

* {
    box-sizing: border-box;
}

html, body, form {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
}

body {
    min-height: 100vh;
    overflow-x: hidden;
}

.login-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    background: radial-gradient(circle at top left, rgba(59,130,246,0.18), transparent 34%), radial-gradient(circle at bottom right, rgba(37,99,235,0.16), transparent 32%), linear-gradient(135deg, #0f172a 0%, #111827 40%, #1e293b 100%);
}

html[data-theme="light"] .login-bg {
    background: radial-gradient(circle at top left, rgba(96,165,250,0.20), transparent 34%), radial-gradient(circle at bottom right, rgba(59,130,246,0.16), transparent 32%), linear-gradient(135deg, #eff6ff 0%, #f8fafc 45%, #e2e8f0 100%);
}

.bg-gradient {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    animation: pulseMove 16s ease-in-out infinite alternate;
    opacity: 0.7;
}

.bg-gradient-1 {
    width: 320px;
    height: 320px;
    background: rgba(59,130,246,0.35);
    top: -60px;
    left: -50px;
}

.bg-gradient-2 {
    width: 280px;
    height: 280px;
    background: rgba(139,92,246,0.26);
    right: 0;
    top: 18%;
    animation-duration: 20s;
}

.bg-gradient-3 {
    width: 260px;
    height: 260px;
    background: rgba(6,182,212,0.22);
    bottom: 0;
    left: 20%;
    animation-duration: 18s;
}

.floating-shape {
    position: absolute;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    backdrop-filter: blur(4px);
    border-radius: 28px;
    animation: floatUpDown 12s ease-in-out infinite;
}

.shape-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 8%;
    transform: rotate(18deg);
}

.shape-2 {
    width: 80px;
    height: 80px;
    top: 68%;
    left: 12%;
    transform: rotate(-18deg);
    animation-duration: 14s;
}

.shape-3 {
    width: 140px;
    height: 140px;
    right: 10%;
    top: 12%;
    transform: rotate(-8deg);
    animation-duration: 15s;
}

.shape-4 {
    width: 90px;
    height: 90px;
    right: 14%;
    bottom: 11%;
    transform: rotate(12deg);
    animation-duration: 13s;
}

.theme-toggle-wrap {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 20;
}

.theme-toggle-btn {
    border: 1px solid var(--border);
    background: var(--theme-btn-bg);
    color: var(--theme-btn-text);
    height: 44px;
    border-radius: 999px;
    padding: 0 16px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: var(--glass);
}

.login-page {
    min-height: 100vh;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.login-shell {
    width: 100%;
    max-width: 1160px;
    min-height: 680px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    border-radius: 30px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: var(--shadow-lg);
    backdrop-filter: var(--glass);
}

.brand-panel {
    background: var(--brand-panel-bg);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    padding: 56px 48px;
    display: flex;
    align-items: center;
}

.brand-content {
    max-width: 470px;
    position: relative;
    z-index: 2;
}

.logo-box {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: rgba(255,255,255,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.16);
    overflow: hidden;
}

.company-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    background: #fff;
}

.logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 700;
    color: #fff;
}

.brand-badge {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.16);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
}

.brand-title {
    margin: 0 0 14px 0;
    font-size: 42px;
    line-height: 1.18;
    font-weight: 700;
}

.brand-text {
    margin: 0;
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    line-height: 1.8;
}

.brand-features {
    margin-top: 28px;
    display: grid;
    gap: 14px;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.90);
    font-size: 14px;
}

.feature-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffffff;
    flex-shrink: 0;
}

.form-panel {
    background: var(--bg-card);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: transparent;
}

.card-header {
    margin-bottom: 24px;
}

    .card-header h2 {
        margin: 0 0 8px 0;
        color: var(--text-main);
        font-size: 32px;
        line-height: 1.2;
    }

    .card-header p {
        margin: 0;
        color: var(--text-soft);
        font-size: 14px;
    }

.alert-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.field-wrap {
    position: relative;
    margin-bottom: 18px;
}

.form-input {
    width: 100%;
    height: 58px;
    border-radius: 16px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    padding: 20px 48px 12px 48px;
    font-size: 15px;
    outline: none;
    transition: all .2s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

    .form-input.with-action {
        padding-right: 80px;
    }

    .form-input:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
    }

.form-label {
    position: absolute;
    left: 46px;
    top: 18px;
    color: var(--text-soft);
    font-size: 14px;
    pointer-events: none;
    transition: all .18s ease;
    background: transparent;
    padding: 0 6px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -9px;
    left: 42px;
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-card-solid);
    border-radius: 8px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 18px;
    font-size: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-action-btn {
    position: absolute;
    right: 12px;
    top: 12px;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    border: none;
    background: rgba(37,99,235,0.10);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.row-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.remember-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-soft);
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

    .text-link:hover {
        text-decoration: underline;
    }

.btn-primary {
    width: 100%;
    height: 54px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    box-shadow: 0 14px 28px rgba(37,99,235,0.24);
}

    .btn-primary:hover {
        transform: translateY(-1px);
    }

    .btn-primary:disabled {
        opacity: .72;
        cursor: not-allowed;
    }

.separator {
    margin: 22px 0 12px 0;
    text-align: center;
    position: relative;
}

    .separator span {
        font-size: 12px;
        color: var(--text-muted);
        background: transparent;
        padding: 0 10px;
    }

.support-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
}

@keyframes floatUpDown {
    0% {
        transform: translateY(0) rotate(10deg);
    }

    50% {
        transform: translateY(-18px) rotate(14deg);
    }

    100% {
        transform: translateY(0) rotate(10deg);
    }
}

@keyframes pulseMove {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(30px, -20px) scale(1.12);
    }
}

@media (max-width: 991px) {
    .login-shell {
        grid-template-columns: 1fr;
        max-width: 560px;
        min-height: auto;
    }

    .brand-panel {
        padding: 34px 28px;
    }

    .brand-title {
        font-size: 32px;
    }

    .form-panel {
        padding: 28px 22px 32px 22px;
    }
}

@media (max-width: 576px) {
    .login-page {
        padding: 14px;
    }

    .login-shell {
        border-radius: 22px;
    }

    .brand-panel {
        padding: 26px 18px;
    }

    .form-panel {
        padding: 22px 16px 24px 16px;
    }

    .brand-title {
        font-size: 26px;
    }

    .card-header h2 {
        font-size: 26px;
    }

    .form-input {
        height: 54px;
        font-size: 14px;
    }

    .btn-primary {
        height: 50px;
        font-size: 15px;
    }

    .theme-toggle-wrap {
        top: 12px;
        right: 12px;
    }

    .theme-toggle-btn {
        height: 40px;
        padding: 0 12px;
    }
}

.login-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-loading-box {
    width: 100%;
    max-width: 320px;
    background: var(--bg-card-solid);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 28px 24px;
    text-align: center;
}

.login-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 16px auto;
    border-radius: 50%;
    border: 4px solid rgba(148,163,184,0.25);
    border-top-color: var(--primary);
    animation: loginSpin .8s linear infinite;
}

.login-loading-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-loading-text {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.5;
}

@keyframes loginSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}
