/* RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Arial, sans-serif;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #f59e0b;
    --text: #172033;
    --muted: #687386;
    --line: #d9e1ef;
    --surface: #ffffff;
    --page: #eef4ff;
    --danger: #b42318;
    --danger-bg: #fff1f0;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(20, 83, 45, 0.88)),
        radial-gradient(circle at 15% 15%, rgba(245, 158, 11, 0.34), transparent 30%),
        var(--page);
    color: var(--text);
}

.login-container {
    width: min(1040px, calc(100% - 32px));
    min-height: 620px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 420px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.login-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px;
    color: #ffffff;
    background:
        linear-gradient(160deg, rgba(15, 23, 42, 0.32), rgba(15, 23, 42, 0.58)),
        linear-gradient(135deg, #2563eb 0%, #166534 100%);
}

.login-hero::before {
    content: "";
    position: absolute;
    inset: 28px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    pointer-events: none;
}

.brand-mark {
    position: absolute;
    top: 48px;
    left: 48px;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #ffffff;
    color: var(--primary);
    font-size: 20px;
    font-weight: 800;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
}

.eyebrow {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    color: rgba(255, 255, 255, 0.82);
}

.login-hero h1 {
    max-width: 520px;
    margin-bottom: 16px;
    font-size: 44px;
    line-height: 1.12;
    letter-spacing: 0;
}

.hero-copy {
    max-width: 500px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 16px;
    line-height: 1.7;
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 42px;
    background: var(--surface);
}

.logo {
    width: max-content;
    margin-bottom: 22px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #eaf1ff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 800;
}

.login-card h2 {
    margin-bottom: 8px;
    color: var(--text);
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: 0;
}

.subtitle {
    margin-bottom: 28px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.login-form {
    width: 100%;
}

.input-group {
    margin-bottom: 18px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.input-group input {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfdff;
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-group input::placeholder {
    color: #98a2b3;
}

.input-group input:focus {
    border-color: var(--primary);
    outline: none;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.13);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 52px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.toggle-password:hover,
.toggle-password:focus-visible {
    background: #edf4ff;
    color: var(--primary);
    outline: none;
}

.eye-icon {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.eye-closed {
    display: none;
}

.toggle-password.is-visible .eye-open {
    display: none;
}

.toggle-password.is-visible .eye-closed {
    display: block;
}

.button-group {
    margin-top: 8px;
}

.button-group button {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button-group button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.34);
}

.button-group button:focus-visible {
    outline: 4px solid rgba(37, 99, 235, 0.18);
    outline-offset: 3px;
}

.alert.error {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid #ffccc7;
    border-radius: 6px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

@media (max-width: 820px) {
    body {
        align-items: flex-start;
        padding: 24px 0;
    }

    .login-container {
        width: min(520px, calc(100% - 28px));
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: 270px;
        padding: 104px 28px 32px;
    }

    .login-hero::before {
        inset: 18px;
    }

    .brand-mark {
        top: 30px;
        left: 28px;
        width: 58px;
        height: 58px;
        font-size: 17px;
    }

    .login-hero h1 {
        font-size: 30px;
    }

    .hero-copy {
        font-size: 14px;
    }

    .login-card {
        padding: 34px 28px;
    }
}

@media (max-width: 420px) {
    .login-container {
        width: calc(100% - 20px);
    }

    .login-hero {
        padding: 96px 22px 28px;
    }

    .login-hero h1 {
        font-size: 26px;
    }

    .login-card {
        padding: 30px 22px;
    }

    .password-wrapper input {
        padding-right: 52px;
    }
}
