:root {
    --bg: #f7fbff;
    --bg-soft: #eef4fb;
    --panel: rgba(255, 255, 255, 0.86);
    --panel-strong: rgba(15, 23, 42, 0.06);
    --text: #1a2a46;
    --muted: #62789c;
    --line: rgba(15, 23, 42, 0.12);
    --accent: #002147;
    --accent-strong: #002147;
    --accent-alt: #003a70;
    --warning-bg: rgba(255, 133, 102, 0.12);
    --warning-border: rgba(255, 133, 102, 0.35);
    --warning-text: #8e341f;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
    --font-body: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
}

body {
    font-family: var(--font-body);
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(0, 33, 71, 0.12), transparent 34%),
        radial-gradient(circle at 85% 15%, rgba(0, 58, 112, 0.1), transparent 26%),
        linear-gradient(135deg, #fbfdff 0%, #f4f8ff 52%, #eef3fb 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    background-image:
        linear-gradient(rgba(31, 53, 94, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 53, 94, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at center, black 42%, transparent 88%);
}

body::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(238, 243, 251, 0.72));
}

.page-shell {
    position: relative;
    min-height: 100vh;
    padding: 40px 24px 28px;
    overflow: hidden;
}

.page-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.55;
    pointer-events: none;
}

.page-glow-left {
    top: -120px;
    left: -140px;
    background: radial-gradient(circle, rgba(0, 33, 71, 0.18), transparent 66%);
}

.page-glow-right {
    right: -120px;
    bottom: -120px;
    background: radial-gradient(circle, rgba(0, 58, 112, 0.16), transparent 66%);
}

.login-layout {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 460px;
    margin: 0 auto;
    min-height: calc(100vh - 120px);
}

.signin-card {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: var(--panel);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
}

.signin-card {
    width: 100%;
    padding: 38px;
    border-radius: 28px;
}

.signin-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
    text-align: center;
}

.signin-brand-logo {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    background: #ffffff;
    object-fit: cover;
    padding: 10px;
}

.signin-brand-copy strong,
.signin-brand-copy span {
    display: block;
}

.signin-brand-copy strong {
    color: var(--text);
    font-size: 1rem;
}

.signin-brand-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.84rem;
}

.signin-header h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 2rem;
    letter-spacing: -0.03em;
}

.signin-kicker {
    margin: 0 0 10px;
    color: #002147;
    font-size: 0.8rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.signin-copy {
    margin: 12px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.login-alert {
    margin-top: 24px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--warning-border);
    background: var(--warning-bg);
    color: var(--warning-text);
    line-height: 1.6;
}

.login-alert p {
    margin: 0;
}

.login-alert-success {
    border-color: rgba(0, 33, 71, 0.2);
    background: rgba(0, 33, 71, 0.08);
    color: #002147;
}

.signin-form {
    margin-top: 28px;
}

.field {
    display: block;
    margin-bottom: 18px;
}

.field-label {
    display: block;
    margin-bottom: 10px;
    color: #304665;
    font-size: 0.93rem;
    font-weight: 600;
}

.field-input {
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 18px;
    background: #ffffff;
    color: var(--text);
    padding: 16px 18px;
    font: inherit;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.field-input::placeholder {
    color: #8a9cb9;
}

.field-input:focus {
    outline: none;
    border-color: rgba(0, 33, 71, 0.56);
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(0, 33, 71, 0.12);
    transform: translateY(-1px);
}

.signin-button {
    width: 100%;
    border: 0;
    border-radius: 18px;
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #ffffff;
    font: inherit;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.signin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(0, 33, 71, 0.24);
    filter: saturate(1.06);
}

.signin-button:focus {
    outline: none;
    box-shadow: 0 0 0 5px rgba(0, 33, 71, 0.16);
}

.signin-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.signin-footer-stack {
    flex-direction: column;
    align-items: flex-start;
}

.signin-footer p {
    margin: 0;
    color: var(--muted);
}

.recovery-contact-list {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.recovery-contact-list span {
    display: block;
}

.recovery-contact-list strong {
    color: var(--text);
}

.signin-footer a {
    color: #002147;
    text-decoration: none;
    font-weight: 700;
}

.signin-footer a:hover,
.signin-footer a:focus {
    text-decoration: underline;
}

.page-footer {
    position: relative;
    z-index: 1;
    max-width: 1240px;
    margin: 24px auto 0;
    color: #6e83a6;
    text-align: center;
}

.page-footer p {
    margin: 0;
    font-size: 0.92rem;
}

@media (max-width: 1040px) {
    .login-layout {
        min-height: calc(100vh - 100px);
    }
}

@media (max-width: 680px) {
    .page-shell {
        padding: 20px 14px 18px;
    }

    .login-layout {
        max-width: 460px;
        min-height: calc(100vh - 72px);
    }

    .signin-card {
        border-radius: 24px;
        padding: 24px;
    }

    .signin-header {
        text-align: left;
    }

    .signin-footer {
        flex-direction: column;
        align-items: flex-start;
    }

}

:root {
    --auth-toggle-bg: rgba(255, 255, 255, 0.92);
    --auth-toggle-border: rgba(15, 23, 42, 0.12);
}

html {
    color-scheme: light;
}

.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--auth-toggle-border);
    border-radius: 50%;
    background: var(--auth-toggle-bg);
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.auth-theme-toggle:hover,
.auth-theme-toggle:focus {
    border-color: rgba(0, 33, 71, 0.4);
    color: var(--accent-strong);
    outline: none;
}

.auth-theme-toggle .theme-toggle-icons {
    position: relative;
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
}

.auth-theme-toggle .theme-toggle-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.82) rotate(-10deg);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.auth-theme-toggle .theme-toggle-icon svg {
    width: 22px;
    height: 22px;
}

.auth-theme-toggle .theme-toggle-icon-moon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] .auth-theme-toggle .theme-toggle-icon-moon {
    opacity: 0;
    transform: scale(0.82) rotate(10deg);
}

html[data-theme="dark"] .auth-theme-toggle .theme-toggle-icon-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #08101d;
    --bg-soft: #0d1728;
    --panel: rgba(9, 16, 29, 0.94);
    --panel-strong: rgba(255, 255, 255, 0.04);
    --text: #e7eefc;
    --muted: #9db1cf;
    --line: rgba(148, 163, 184, 0.16);
    --accent: #002147;
    --accent-strong: #002147;
    --accent-alt: #1a3f6f;
    --warning-bg: rgba(255, 133, 102, 0.16);
    --warning-border: rgba(255, 133, 102, 0.3);
    --warning-text: #ffd6cb;
    --shadow: 0 18px 46px rgba(2, 6, 23, 0.38);
    --auth-toggle-bg: rgba(9, 16, 29, 0.94);
    --auth-toggle-border: rgba(148, 163, 184, 0.18);
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top left, rgba(0, 33, 71, 0.22), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(26, 63, 111, 0.2), transparent 24%),
        linear-gradient(135deg, #060d19 0%, #0c1526 52%, #111b2f 100%);
}

html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.07) 1px, transparent 1px);
}

html[data-theme="dark"] body::after {
    background: linear-gradient(180deg, rgba(4, 10, 20, 0.24), rgba(2, 6, 15, 0.78));
}

html[data-theme="dark"] .signin-card {
    background: var(--panel);
    border-color: var(--line);
}

html[data-theme="dark"] .signin-brand-logo {
    background: rgba(255, 255, 255, 0.96);
}

html[data-theme="dark"] .signin-copy,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .signin-footer p,
html[data-theme="dark"] .recovery-contact-list,
html[data-theme="dark"] .page-footer {
    color: var(--muted);
}

html[data-theme="dark"] .recovery-contact-list strong {
    color: var(--text);
}

html[data-theme="dark"] .field-input {
    background: #0b1527;
    border-color: rgba(148, 163, 184, 0.22);
    color: var(--text);
}

html[data-theme="dark"] .field-input::placeholder {
    color: #8aa0bf;
}

html[data-theme="dark"] .login-alert {
    background: rgba(255, 133, 102, 0.14);
    border-color: rgba(255, 133, 102, 0.28);
    color: var(--warning-text);
}

html[data-theme="dark"] .login-alert-success {
    background: rgba(26, 63, 111, 0.16);
    border-color: rgba(169, 196, 232, 0.2);
    color: #dbe8fb;
}

html[data-theme="dark"] .signin-kicker {
    color: #a9c4e8;
}

html[data-theme="dark"] .signin-footer a {
    color: #a9c4e8;
}

html[data-theme="dark"] .signin-button {
    background: linear-gradient(135deg, var(--accent-alt), var(--accent));
    color: #ffffff;
}
