:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --text: #101828;
    --muted: #667085;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #0f766e;
    --border: #d9e0ea;
    --danger: #b42318;
    --danger-bg: #fff2f0;
    --success: #067647;
    --success-bg: #ecfdf3;
    --shadow: 0 22px 55px rgba(16, 24, 40, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 38%),
        linear-gradient(215deg, rgba(15, 118, 110, 0.08), transparent 42%),
        var(--bg);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.is-auth-checking body {
    visibility: hidden;
}

a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.page {
    display: grid;
    min-height: 100svh;
    place-items: center;
    padding: 18px;
}

.panel {
    width: min(100%, 420px);
    padding: clamp(22px, 4vw, 34px);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: var(--text);
    font-size: 13px;
    line-height: 1;
}

.eyebrow {
    margin: 0 0 9px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0 0 10px;
    color: var(--text);
    font-size: clamp(28px, 5vw, 34px);
    line-height: 1.12;
}

.lead {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.55;
}

.message {
    display: none;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
}

.message.is-visible {
    display: block;
}

.message.is-error {
    border-color: #fecdca;
    color: var(--danger);
    background: var(--danger-bg);
}

.message.is-success {
    border-color: #abefc6;
    color: var(--success);
    background: var(--success-bg);
}

.form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 7px;
}

label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 7px;
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover {
    background: var(--primary-dark);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}

button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.switch-link {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 14px;
    text-align: center;
}

.forgot-password-link {
    margin: -2px 0 0;
    font-size: 14px;
    text-align: right;
}

@media (max-width: 520px) {
    .page {
        padding: 12px;
    }

    .panel {
        padding: 22px;
    }

    .brand {
        margin-bottom: 14px;
    }

    .lead {
        margin-bottom: 20px;
        font-size: 15px;
    }
}

@media (max-height: 560px) {
    .panel {
        padding: 18px;
    }

    .brand,
    .lead,
    .switch-link {
        margin-bottom: 12px;
    }

    h1 {
        margin-bottom: 6px;
    }

    .form {
        gap: 10px;
    }

    input,
    button {
        min-height: 42px;
    }
}
