:root {
    --auth-bg-a: #0f2241;
    --auth-bg-b: #112f58;
    --auth-accent: #10b7a6;
    --auth-accent-dark: #0e988b;
    --auth-card-bg: #f7fafc;
    --auth-card-border: #d8e3ef;
    --auth-text: #17223b;
    --auth-muted: #6f819b;
    --auth-input-border: #d7e2ee;
    --auth-input-focus: #84c5dd;
    --auth-white: #ffffff;
}

body.auth-page {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--auth-text);
    min-height: 100vh;
    background: radial-gradient(circle at 50% 50%, #0a6d87 0%, rgba(10, 109, 135, 0) 32%),
        linear-gradient(120deg, var(--auth-bg-a) 0%, var(--auth-bg-b) 100%);
}

.auth-bg {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(16, 183, 166, 0.14), transparent 42%),
        radial-gradient(circle at 80% 70%, rgba(16, 183, 166, 0.12), transparent 45%);
    pointer-events: none;
}

.auth-container {
    position: relative;
    min-height: 100vh;
    width: 100%;
    padding: 40px 18px 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.auth-card {
    width: min(100%, 468px);
    background: var(--auth-card-bg);
    border: 1px solid var(--auth-card-border);
    border-radius: 20px;
    padding: 26px 30px 28px;
    box-shadow: none;
}

.auth-card-wide {
    width: min(100%, 840px);
}

.auth-brand {
    text-align: center;
    margin-bottom: 18px;
}

.auth-brand-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 14px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #10c7b4, #0ca091);
    color: #fff;
    font-size: 30px;
    box-shadow: none;
}

.auth-title {
    margin: 0;
    font-size: 2.35rem;
    line-height: 1.1;
    font-weight: 700;
    color: #152039;
}

.auth-brand-name {
    margin: 0;
    font-size: 2.7rem;
    line-height: 1.05;
    font-weight: 700;
    color: #152039;
}

.auth-subtitle {
    margin: 7px 0 0;
    color: var(--auth-muted);
    font-size: 1.03rem;
    font-weight: 500;
}

.auth-divider {
    margin: 16px 0 18px;
    border: 0;
    border-top: 1px solid #dce6f1;
}

.auth-alert {
    border-radius: 12px;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.auth-form-group {
    margin-bottom: 14px;
}

.auth-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.98rem;
    font-weight: 600;
    color: #3f4f66;
}

.auth-input-wrap {
    position: relative;
}

.auth-input {
    width: 100%;
    border: 1px solid var(--auth-input-border);
    background: #fff;
    border-radius: 11px;
    padding: 12px 44px 12px 13px;
    font-size: 1rem;
    color: #223250;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input::placeholder {
    color: #9aabc0;
}

.auth-input:focus {
    border-color: var(--auth-input-focus);
    box-shadow: 0 0 0 3px rgba(132, 197, 221, 0.24);
}

.auth-password-toggle {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #8ea0b6;
    font-size: 1.05rem;
    line-height: 1;
    padding: 6px;
    cursor: pointer;
}

.auth-inline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 6px 0 14px;
}

.auth-inline-right {
    justify-content: flex-end;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4a5d79;
    font-size: 0.97rem;
    font-weight: 600;
}

.auth-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--auth-accent);
}

.auth-link {
    color: var(--auth-accent);
    text-decoration: none;
    font-weight: 700;
}

.auth-link:hover {
    color: var(--auth-accent-dark);
    text-decoration: underline;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(180deg, #0faba0, #0b988d);
    color: #fff;
    padding: 12px 16px;
    font-size: 1.25rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
}

.auth-btn:hover {
    background: linear-gradient(180deg, #0ea196, #0a8a80);
    color: #fff;
}

.auth-btn i {
    font-size: 1.18rem;
}

.auth-btn-secondary {
    width: auto;
    min-width: 120px;
    background: #fff;
    color: #355173;
    border: 1px solid #c7d7e8;
    box-shadow: none;
}

.auth-btn-secondary:hover {
    background: #f4f8fc;
    color: #2a4566;
}

.auth-bottom-note {
    text-align: center;
    margin-top: 16px;
    font-size: 1.05rem;
    color: var(--auth-muted);
}

.auth-legal {
    text-align: center;
    color: #8ea0b6;
    font-size: 1rem;
}

.auth-legal a {
    color: #9eb1c8;
    text-decoration: none;
    margin: 0 10px;
}

.auth-legal a:hover {
    color: #c1d2e5;
    text-decoration: underline;
}

.auth-legal small {
    display: block;
    margin-top: 12px;
    color: #7387a2;
}

.mfa-help-list {
    margin: 0 0 14px;
    padding-left: 18px;
    color: #4e607a;
    font-size: 0.95rem;
}

.mfa-help-list li {
    margin-bottom: 6px;
}

.mfa-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.mfa-qr-panel {
    width: 196px;
    height: 196px;
    border: 1px solid #d6e2ef;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mfa-qr-panel img,
.mfa-qr-panel canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.mfa-manual-panel {
    background: #f2f7fc;
    border: 1px solid #d6e2ef;
    border-radius: 12px;
    padding: 13px 14px;
}

.mfa-secret {
    background: #fff;
    border: 1px solid #cddbea;
    border-radius: 10px;
    padding: 9px 11px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    word-break: break-all;
}

.mfa-uri {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    color: #51627b;
    word-break: break-all;
}

.mfa-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.backup-codes {
    border: 1px solid #f0d99f;
    background: #fff7e2;
    border-radius: 10px;
    padding: 11px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
}

@media (max-width: 768px) {
    .auth-container {
        padding-top: 24px;
    }
    .auth-card {
        padding: 22px 18px 22px;
        border-radius: 16px;
    }
    .auth-title {
        font-size: 1.95rem;
    }
    .auth-brand-name {
        font-size: 2.2rem;
    }
    .auth-btn {
        font-size: 1.12rem;
    }
    .mfa-grid {
        grid-template-columns: 1fr;
    }
    .mfa-qr-panel {
        margin: 0 auto;
    }
}
