:root {
    --primary: #c5295c;
    --primary-dark: #8f183f;
    --accent: #f9a61a;
    --ink: #231820;
    --muted: #776d73;
    --line: #e9e1e5;
    --danger: #bb2947;
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: var(--ink);
    background: #f7f2f5;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }

.login-page {
    width: 100%;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 48px);
    background:
        radial-gradient(circle at 16% 10%, rgba(197, 41, 92, .08), transparent 24rem),
        radial-gradient(circle at 92% 90%, rgba(249, 166, 26, .08), transparent 20rem),
        linear-gradient(145deg, #fff, #f7f2f5);
}

.login-access,
.password-reset-access {
    width: 100%;
    min-height: calc(100dvh - clamp(36px, 8vw, 96px));
    display: grid;
    place-items: center;
}

.login-card {
    position: relative;
    width: min(440px, 100%);
    padding: clamp(25px, 4vw, 36px);
    overflow: hidden;
    border: 1px solid rgba(117, 76, 94, .14);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(72, 24, 45, .12);
}

.login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-dark), var(--primary), var(--accent));
}

.login-logo {
    width: min(280px, 88%);
    height: 86px;
    display: grid;
    place-items: center;
    margin: 0 auto 20px;
    padding: 8px 12px;
}

.login-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.login-system-heading { margin: -5px 0 22px; text-align: center; }
.login-system-heading span { color: var(--primary); font-size: .68rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.login-system-heading h1 { margin: 5px 0 0; font-size: clamp(1.25rem, 4vw, 1.65rem); line-height: 1.15; letter-spacing: -.03em; }
.nip-intro { text-align: center; }
.nip-intro strong { font-size: 1rem; }
.nip-intro p { margin: 5px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
#nip { padding: 0 14px; text-align: center; font-size: 1.35rem; font-weight: 850; letter-spacing: .38em; }
.nip-resend { margin-top: 12px; text-align: center; }
.nip-resend button { border: 0; color: var(--primary-dark); background: transparent; font-size: .8rem; font-weight: 750; text-decoration: underline; }

.login-card__header { margin: 0 0 22px; text-align: center; }
.login-card__header h2 {
    margin: 0 0 7px;
    font-size: clamp(1.65rem, 4vw, 2.1rem);
    line-height: 1.08;
    letter-spacing: -.035em;
}
.login-card__header p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.eyebrow { color: var(--primary); font-size: .7rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 15px;
    padding: 11px 13px;
    border: 1px solid;
    border-radius: 11px;
    font-size: .82rem;
    line-height: 1.45;
}
.alert svg { width: 18px; flex: 0 0 18px; }
.alert--error { color: #8d1e39; border-color: #efc7d1; background: #fff3f6; }
.alert--success { color: #12684e; border-color: #bde6d7; background: #effbf6; }

.login-form { display: grid; gap: 14px; }
.form-group { display: grid; gap: 6px; }
.form-group label { font-size: .84rem; font-weight: 760; }

.input-shell {
    min-height: 52px;
    display: flex;
    align-items: center;
    border: 1px solid #e2d8dd;
    border-radius: 12px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.input-shell:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(197, 41, 92, .1); }
.input-shell--error { border-color: #d75b74; }
.input-shell__icon { width: 46px; flex: 0 0 46px; display: grid; place-items: center; color: #998d94; }
.input-shell__icon svg { width: 19px; }

.input-shell input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0 14px 0 0;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: .94rem;
}
.input-shell > input:first-child { padding-left: 14px; }
.input-shell input::placeholder { color: #aaa0a6; }

.password-toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    margin-right: 3px;
    border: 0;
    border-radius: 10px;
    color: #8a7e85;
    background: transparent;
    cursor: pointer;
}
.password-toggle:hover { color: var(--primary); background: #fbf1f5; }
.password-toggle svg { width: 20px; }
.password-toggle .eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }

.form-error { min-height: 15px; color: var(--danger); font-size: .74rem; line-height: 15px; }

.login-button {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #ad1d4d);
    box-shadow: 0 13px 28px rgba(197, 41, 92, .24);
    font-weight: 800;
    cursor: pointer;
}
.login-button:hover { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(197, 41, 92, .3); }
.login-button:disabled { cursor: wait; opacity: .72; transform: none; }
.login-button__arrow { width: 19px; }
.login-button__loader { display: none; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.login-button.is-loading .login-button__loader { display: block; }
.login-button.is-loading .login-button__arrow { display: none; }

.forgot-password {
    justify-self: center;
    color: var(--primary-dark);
    font-size: .81rem;
    font-weight: 750;
    text-decoration: none;
}
.forgot-password:hover { color: var(--primary); text-decoration: underline; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
    .login-page { padding: 12px; }
    .login-access, .password-reset-access { min-height: calc(100dvh - 24px); }
    .login-card { padding: 24px 19px 22px; border-radius: 18px; }
    .login-logo { width: min(250px, 90%); height: 72px; margin-bottom: 16px; }
}

@media (max-height: 650px) {
    .login-page { padding-block: 10px; }
    .login-access, .password-reset-access { min-height: calc(100dvh - 20px); }
    .login-card { padding-block: 19px; }
    .login-logo { height: 58px; margin-bottom: 10px; }
    .login-form { gap: 9px; }
    .input-shell { min-height: 46px; }
    .input-shell input { height: 44px; }
    .login-button { min-height: 47px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

.login-system-heading p{font-size:.85rem;line-height:1.45;color:#596475;margin:.5rem 0 0}.setup-key{display:block;overflow-wrap:anywhere;padding:12px;background:#f6f1f5;border-radius:8px;text-align:center;letter-spacing:1px}#authenticatorQr{display:flex;justify-content:center;padding:12px;background:#fff} .nip-intro p{font-size:.9rem;line-height:1.5} .login-page{overflow-y:auto!important}.login-card{margin:24px auto}
