:root {
    --bg1: #0f172a;
    --bg2: #1d3a8a;
    --surface: rgba(255, 255, 255, .92);
    --ink: #111827;
    --muted: #64748b;
    --line: #dbe3f0;
    --brand: #31579a;
    --brand2: #0ea5e9;
    --bad: #b91c1c;
    --ok: #15803d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 10%, rgba(14, 165, 233, .34), transparent 22rem),
        radial-gradient(circle at 90% 20%, rgba(49, 87, 154, .45), transparent 24rem),
        linear-gradient(135deg, var(--bg1), var(--bg2));
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.auth-card {
    width: min(100%, 430px);
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 32px;
    padding: 2rem;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
    backdrop-filter: blur(18px);
}

.logo {
    width: 86px;
    height: 86px;
    margin: 0 auto 1rem;
    border-radius: 28px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(49, 87, 154, .14), rgba(14, 165, 233, .16));
    border: 1px solid rgba(49, 87, 154, .18);
}

.logo img {
    width: 58px;
    height: 58px;
    object-fit: contain;
}

h1 {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.2rem);
    text-align: center;
    letter-spacing: -.04em;
}

.form-subtitle {
    margin: .55rem auto 1.3rem;
    text-align: center;
    color: var(--muted);
    line-height: 1.55;
}

.form-group { margin-bottom: 1rem; }

label {
    display: block;
    margin-bottom: .45rem;
    font-size: .85rem;
    font-weight: 800;
    color: #334155;
}

.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: .9rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand);
}

.input-field {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .78rem 2.8rem .78rem 2.65rem;
    font: inherit;
    outline: none;
    background: #fff;
}

.input-field:focus {
    border-color: var(--brand2);
    box-shadow: 0 0 0 .22rem rgba(14, 165, 233, .14);
}

.password-toggle {
    position: absolute;
    right: .65rem;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.password-toggle:hover { background: #f1f5f9; }

.btn {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #31579a, #0ea5e9);
    color: #fff;
    font-weight: 900;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 16px 34px rgba(49, 87, 154, .24);
}

.btn:hover { filter: brightness(.96); }

.form-footer {
    margin-top: 1rem;
    text-align: center;
    color: var(--muted);
    font-size: .92rem;
}

.form-footer p { margin: .45rem 0; }

a {
    color: var(--brand);
    font-weight: 800;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

.message {
    border-radius: 16px;
    padding: .85rem .95rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    line-height: 1.45;
}

.error-message { background: #fee2e2; color: var(--bad); }
.success-message { background: #dcfce7; color: var(--ok); }
.info-message { background: #e0f2fe; color: #0369a1; overflow-wrap: anywhere; }

.signature {
    margin-top: 1.2rem;
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
}

.signature span {
    color: var(--brand);
    font-weight: 900;
}

.dev-note {
    margin-top: 1rem;
    padding: .8rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #475569;
    font-size: .82rem;
    line-height: 1.5;
}

@media (max-width: 460px) {
    .auth-card {
        padding: 1.25rem;
        border-radius: 24px;
    }

    .logo {
        width: 72px;
        height: 72px;
        border-radius: 22px;
    }

    .logo img {
        width: 48px;
        height: 48px;
    }
}
