:root {
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface-muted: #f8fafc;

    --text-primary: #18212f;
    --text-secondary: #667085;

    --border: #d8dee8;
    --border-focus: #29384f;

    --primary: #1f2937;
    --primary-hover: #111827;

    --danger-background: #fff4f4;
    --danger-border: #f0b8b8;
    --danger-text: #8a1c1c;

    --success-background: #f1faf4;
    --success-border: #b7ddc2;
    --success-text: #24633a;

    --shadow:
        0 20px 45px rgba(15, 23, 42, 0.08),
        0 4px 12px rgba(15, 23, 42, 0.04);

    --radius-lg: 18px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    color: var(--text-primary);
    background: var(--background);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input {
    font: inherit;
}

a {
    color: inherit;
}

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;
}

.login-panel {
    width: 100%;
    max-width: 430px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 12px;
    margin-bottom: 28px;
}

.login-brand__mark {
    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    border-radius: 13px;

    background: var(--primary);
    color: #ffffff;

    font-size: 22px;
    font-weight: 800;
}

.login-brand__name {
    margin: 0;

    font-size: 24px;
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.login-brand__subtitle {
    margin: 4px 0 0;

    color: var(--text-secondary);

    font-size: 13px;
}

.login-card {
    padding: 32px;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-card__header {
    margin-bottom: 26px;
}

.login-card__header h2 {
    margin: 0;

    font-size: 22px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.login-card__header p {
    margin: 7px 0 0;

    color: var(--text-secondary);

    font-size: 14px;
    line-height: 1.5;
}

.login-alert,
.login-success {
    margin-bottom: 20px;
    padding: 13px 14px;

    border: 1px solid;
    border-radius: var(--radius-sm);

    font-size: 13px;
    line-height: 1.5;
}

.login-alert {
    color: var(--danger-text);
    background: var(--danger-background);
    border-color: var(--danger-border);
}

.login-alert strong {
    display: block;
    margin-bottom: 3px;
}

.login-alert ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.login-success {
    color: var(--success-text);
    background: var(--success-background);
    border-color: var(--success-border);
}

.login-form {
    display: flex;
    flex-direction: column;

    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;

    gap: 7px;
}

.form-group label,
.form-label-row label {
    font-size: 13px;
    font-weight: 650;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;
}

.form-label-row a {
    color: var(--text-secondary);

    font-size: 12px;
    text-decoration: none;
}

.form-label-row a:hover {
    text-decoration: underline;
}

.form-group input {
    width: 100%;
    height: 46px;

    padding: 0 13px;

    border: 1px solid var(--border);
    border-radius: var(--radius-md);

    color: var(--text-primary);
    background: var(--surface);

    outline: none;

    transition:
        border-color 120ms ease,
        box-shadow 120ms ease;
}

.form-group input:focus {
    border-color: var(--border-focus);

    box-shadow:
        0 0 0 3px rgba(41, 56, 79, 0.10);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;

    top: 50%;
    right: 8px;

    transform: translateY(-50%);

    padding: 6px 8px;

    border: 0;
    border-radius: 6px;

    color: var(--text-secondary);
    background: transparent;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;
}

.password-toggle:hover {
    background: var(--surface-muted);
}

.remember-field {
    display: flex;
    align-items: flex-start;

    gap: 9px;

    color: var(--text-secondary);

    font-size: 13px;
    line-height: 1.4;

    cursor: pointer;
}

.remember-field input {
    width: 16px;
    height: 16px;

    margin: 1px 0 0;

    accent-color: var(--primary);
}

.login-button {
    width: 100%;
    min-height: 46px;

    border: 0;
    border-radius: var(--radius-md);

    color: #ffffff;
    background: var(--primary);

    font-weight: 700;

    cursor: pointer;

    transition:
        background 120ms ease,
        transform 80ms ease;
}

.login-button:hover {
    background: var(--primary-hover);
}

.login-button:active {
    transform: translateY(1px);
}

.login-button:focus-visible,
.password-toggle:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(41, 56, 79, 0.20);
    outline-offset: 2px;
}

.login-footer {
    margin: 22px 0 0;

    color: var(--text-secondary);

    font-size: 12px;
    text-align: center;
}

@media (max-width: 520px) {
    .login-page {
        align-items: flex-start;

        padding: 28px 15px;
    }

    .login-brand {
        justify-content: flex-start;

        margin-bottom: 22px;
    }

    .login-card {
        padding: 24px 20px;
    }

    .login-card__header h2 {
        font-size: 20px;
    }

    .form-label-row {
        align-items: flex-start;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 21px 16px;
    }

    .login-brand__subtitle {
        font-size: 12px;
    }
}
