@font-face {
    font-family: "Montserrat";
    src: url("/static/fonts/Montserrat-Regular.ttf") format("truetype");
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("/static/fonts/Montserrat-Medium.ttf") format("truetype");
    font-weight: 500; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("/static/fonts/Montserrat-SemiBold.ttf") format("truetype");
    font-weight: 600; font-display: swap;
}
@font-face {
    font-family: "Montserrat";
    src: url("/static/fonts/Montserrat-Bold.ttf") format("truetype");
    font-weight: 700; font-display: swap;
}

:root {
    --brand: #00b0c9;
    --brand-dark: #0093a8;
    --brand-soft: #e6f7fa;
    --ink: #1d1d1f;
    --ink-muted: #6e6e73;
    --line: #e5e5e7;
    --bg: #f5f7f8;
    --white: #ffffff;
    --red: #d14249;
}

* { box-sizing: border-box; }

body {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #e6f7fa 0%, #f5f7f8 100%);
    color: var(--ink);
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrap {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--white);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 176, 201, 0.15),
                0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 40px 32px 32px;
    text-align: center;
}

.login-card .logo {
    height: 64px;
    width: auto;
    margin-bottom: 20px;
}

.login-card h1 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.login-card .subtitle {
    margin: 0 0 28px;
    font-size: 13px;
    color: var(--ink-muted);
    font-weight: 400;
}

.field {
    text-align: left;
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: var(--white);
    transition: all 0.12s ease;
}

.field input:hover {
    border-color: #c8c8cd;
}

.field input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0, 176, 201, 0.15);
}

.btn {
    width: 100%;
    padding: 14px 24px;
    margin-top: 8px;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: var(--white);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 14px rgba(0, 176, 201, 0.35);
}

.btn:hover {
    background: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 176, 201, 0.4);
}

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

.error {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #fdf1f2;
    border-left: 3px solid var(--red);
    border-radius: 8px;
    color: #a3242b;
    font-size: 13px;
    text-align: left;
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 20px 24px;
        border-radius: 16px;
    }
    .login-card .logo { height: 52px; }
    .login-card h1 { font-size: 18px; }
}

/* ============ Двухфакторка ============ */

.twofa-hint {
    font-size: 13px;
    color: var(--ink-muted);
    text-align: left;
    margin: 0 0 16px;
    line-height: 1.5;
}
.twofa-hint a {
    color: var(--brand-dark);
    font-weight: 600;
    text-decoration: none;
}

.info {
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #e6f7fa;
    border-left: 3px solid var(--brand);
    border-radius: 8px;
    color: var(--brand-dark);
    font-size: 13px;
    text-align: left;
}

.btn-secondary {
    background: #f0f0f2;
    color: var(--ink);
    box-shadow: none;
}
.btn-secondary:hover {
    background: #e0e0e2;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.twofa-footer {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
}
.twofa-footer a {
    color: var(--ink-muted);
    text-decoration: none;
}
.twofa-footer a:hover { color: var(--brand-dark); }

#code {
    font-size: 24px;
    text-align: center;
    letter-spacing: 0.3em;
    font-weight: 700;
    font-family: "Montserrat", monospace;
}
