html,
body {
    height: 100%;
}

body {
    background: var(--page-bg);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    position: relative;
    overflow: hidden;
    background-color: #0b1018;
    background-image: url('../assets/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(11, 16, 24, 0.72) 0%, rgba(11, 16, 24, 0.55) 50%, rgba(11, 16, 24, 0.78) 100%),
        radial-gradient(700px 420px at 20% 20%, rgba(183, 137, 58, 0.18), transparent 65%),
        radial-gradient(600px 380px at 85% 85%, rgba(45, 55, 72, 0.35), transparent 70%);
    pointer-events: none;
    transition: background 0.25s ease;
    z-index: 0;
}

html[data-theme="dark"] .login-page::before {
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.62) 50%, rgba(0, 0, 0, 0.85) 100%),
        radial-gradient(700px 420px at 20% 20%, rgba(183, 137, 58, 0.22), transparent 65%),
        radial-gradient(600px 380px at 85% 85%, rgba(0, 0, 0, 0.45), transparent 70%);
}

.login-theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5;
}

.login-theme-toggle .theme-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-theme-toggle .theme-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .login-theme-toggle .theme-toggle {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.12);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: 30px;
    padding: 42px 36px 32px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: background 0.25s ease, border-color 0.25s ease;
    animation: loginRise 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

html[data-theme="dark"] .login-card {
    background: rgba(26, 32, 41, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

@keyframes loginRise {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-card {
        animation: none;
    }
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.login-brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-bottom: 14px;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 0.02em;
    margin: 0 0 4px;
    color: var(--ink);
}

.login-brand p {
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin: 0;
}

.login-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
    background: var(--danger-soft);
    color: var(--danger);
    border: 1px solid rgba(192, 41, 63, 0.22);
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.45;
}

html[data-theme="dark"] .login-error {
    border-color: rgba(224, 90, 110, 0.32);
}

.login-error svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 15px;
    font-weight: 400;
    color: var(--ink);
    margin: 25px 0 25px;
}

.login-field input {
    width: 100%;
    padding: 13px 16px;
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.18s ease, background 0.2s ease;
    box-sizing: border-box;
}

html[data-theme="dark"] .login-field input {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.login-field input::placeholder {
    color: var(--ink-soft);
    opacity: 0.7;
}

.login-field input:hover {
    border-color: var(--accent);
}

.login-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.password-wrap {
    position: relative;
}

.password-wrap input {
    padding-right: 52px;
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.toggle-password:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

html[data-theme="dark"] .toggle-password:hover {
    background: rgba(255, 255, 255, 0.08);
}

.toggle-password:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password .eye-off {
    display: none;
}

.toggle-password.is-visible .eye-on {
    display: none;
}

.toggle-password.is-visible .eye-off {
    display: block;
}

.login-btn {
    width: 100%;
    min-height: 48px;
    margin-top: 10px;
    padding: 14px 20px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.15s ease, transform 0.08s ease, opacity 0.15s ease;
}

.login-btn:hover:not(:disabled) {
    background: var(--accent-hover);
}

.login-btn:active:not(:disabled) {
    transform: scale(0.985);
}

.login-btn:disabled {
    opacity: 0.75;
    cursor: progress;
}

.login-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: loginSpin 0.7s linear infinite;
    display: none;
}

.login-btn.loading .login-spinner {
    display: inline-block;
}

.login-btn.loading .btn-label {
    opacity: 0.85;
}

@keyframes loginSpin {
    to {
        transform: rotate(360deg);
    }
}

.login-footer {
    text-align: center;
    margin-top: 26px;
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.06em;
}

.login-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

html[data-theme="dark"] .login-info {
    border-color: rgba(108, 122, 148, 0.35);
}

.login-info svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent);
}

.login-info-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.otp-countdown {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-soft);
    letter-spacing: 0.02em;
    margin-bottom: 30px !important;
}

.otp-countdown .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(27, 122, 76, 0.18);
    animation: otpPulse 1.6s ease-in-out infinite;
}

.otp-countdown b {
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.06em;
    font-variant-numeric: tabular-nums;
}

.otp-countdown.warning .dot {
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(183, 137, 58, 0.2);
}

.otp-countdown.warning b {
    color: var(--gold);
}

.otp-countdown.expired .dot {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(192, 41, 63, 0.2);
    animation: none;
}

.otp-countdown.expired b {
    color: var(--danger);
}

@keyframes otpPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.35;
    }
}

@media (prefers-reduced-motion: reduce) {
    .otp-countdown .dot {
        animation: none;
    }
}

.login-step-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    text-align: center;
    margin: 0 0 10px;
}

.otp-wrap {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 4px 0 18px;
}

.otp-box {
    width: 100%;
    flex: 1 1 0;
    min-width: 0;
    height: 56px;
    text-align: center;
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    outline: none;
    padding: 0;
    transition: border-color 0.15s ease, box-shadow 0.18s ease, background 0.2s ease;
    box-sizing: border-box;
    letter-spacing: 0;
}

html[data-theme="dark"] .otp-box {
    background: rgba(0, 0, 0, 0.25);
    border-color: rgba(255, 255, 255, 0.1);
}

.otp-box:hover {
    border-color: var(--accent);
}

.otp-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.otp-box:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.login-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
}

.login-inline-form {
    margin: 0;
}

.login-link {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12px;
    color: var(--ink-soft);
    cursor: pointer;
    padding: 6px 4px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.login-link:hover:not(:disabled) {
    color: var(--ink);
    background: var(--bg-soft);
}

html[data-theme="dark"] .login-link:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
}

.login-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.login-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}