@font-face {
    font-family: "Noto Sans";
    src: url("../../fonts/NotoSans-Regular.ttf") format("truetype");
    font-display: swap;
    font-weight: 400;
}

@font-face {
    font-family: "Noto Sans";
    src: url("../../fonts/NotoSans-SemiBold.ttf") format("truetype");
    font-display: swap;
    font-weight: 600;
}

@font-face {
    font-family: "Noto Sans";
    src: url("../../fonts/NotoSans-Bold.ttf") format("truetype");
    font-display: swap;
    font-weight: 700;
}

:root {
    color-scheme: light;
    --ink: oklch(27% 0.035 252);
    --muted: oklch(52% 0.035 252);
    --border: oklch(88% 0.018 242);
    --quiet: oklch(97.2% 0.009 242);
    --paper: oklch(99% 0.004 242);
    --blue: oklch(55% 0.14 238);
    --blue-deep: oklch(46% 0.13 240);
    --blue-soft: oklch(94% 0.035 235);
    --navy-deep: oklch(19% 0.055 252);
    --stage-text: oklch(96% 0.01 235);
    --danger: oklch(55% 0.19 25);
    --focus-ring: 0 0 0 3px oklch(55% .14 238 / .14);
    --field-shadow: 0 1px 2px oklch(20% .02 250 / .04);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: "Noto Sans", Inter, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible {
    border-radius: 2px;
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--paper);
    color: var(--blue-deep);
    font-size: .82rem;
    font-weight: 700;
    transform: translateY(-150%);
    transition: transform 160ms var(--ease-out);
}

.skip-link:focus {
    transform: translateY(0);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(540px, 1.3fr) minmax(560px, .7fr);
}

.signal-stage {
    position: relative;
    display: flex;
    min-width: 0;
    overflow: hidden;
    padding: 38px clamp(38px, 5vw, 76px) 30px;
    flex-direction: column;
    isolation: isolate;
    background: var(--navy-deep);
    color: var(--stage-text);
}

.brand {
    position: relative;
    z-index: 2;
    height: 52px;
    margin-top: 16px;
}

.brand img {
    width: 228px;
    height: auto;
    user-select: none;
}

.stage-copy {
    position: relative;
    z-index: 2;
    max-width: 640px;
    width: 100%;
    margin-top: auto;
    margin-bottom: 34px;
    text-align: left;
}

.eyebrow {
    display: flex;
    margin: 0 0 16px;
    align-items: center;
    color: oklch(84% .025 235);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.stage-copy h1 {
    max-width: 18ch;
    margin: 0;
    color: oklch(98% .005 235);
    font-size: clamp(2.65rem, 4vw, 4.25rem);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.03;
    text-wrap: balance;
}

.stage-copy h1 em {
    font-family: "Noto Sans", Inter, system-ui, sans-serif;
    font-weight: 600;
    letter-spacing: 0;
    font-style: italic;
}

.stage-copy > p:last-child {
    max-width: 50ch;
    margin: 18px 0 0;
    color: oklch(86% .025 238);
    font-size: .92rem;
    line-height: 1.55;
}

.stage-footer,
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .72rem;
}

.stage-footer {
    position: relative;
    z-index: 2;
    margin-top: 0;
    color: oklch(78% .02 238);
}

.stage-footer a {
    color: oklch(86% .04 230);
    font-weight: 600;
    text-decoration: none;
}

.stage-photo-preview,
.stage-photo,
.stage-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage-photo-preview,
.stage-photo {
    z-index: -3;
    object-fit: cover;
    object-position: 52% center;
}

.stage-photo-preview {
    filter: blur(12px) saturate(.82);
    transform: scale(1.08);
}

.stage-photo {
    filter: saturate(.98) contrast(1.03);
    opacity: 0;
    transform: scale(1.018);
    transition: opacity 280ms ease;
}

.stage-photo.is-loaded {
    opacity: 1;
}

.stage-overlay {
    z-index: -2;
    background:
        linear-gradient(180deg, oklch(10% .035 250 / .28) 0%, transparent 28%),
        linear-gradient(90deg, oklch(10% .045 252 / .56) 0%, oklch(11% .045 252 / .34) 42%, transparent 100%),
        linear-gradient(0deg, oklch(9% .035 252 / .42) 0%, transparent 50%);
}

.stage-footer a:hover {
    color: oklch(97% .006 235);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-stage {
    position: relative;
    display: flex;
    min-width: 0;
    padding: 34px clamp(34px, 4vw, 64px) 26px;
    flex-direction: column;
    background: var(--paper);
}

.app-version {
    position: absolute;
    right: clamp(34px, 4vw, 64px);
    bottom: 26px;
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .02em;
    opacity: .7;
    user-select: none;
}

.mobile-brand {
    display: none;
}

.auth-wrap {
    width: min(100%, 500px);
    margin: auto;
}

.auth-heading h2 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 2.15rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
}

.auth-heading p {
    margin: 0 0 38px;
    color: var(--muted);
    font-size: .88rem;
}

.field {
    margin-bottom: 23px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: .78rem;
    font-weight: 700;
}

.password-field {
    position: relative;
}

.forgot-password-link {
    position: absolute;
    top: 0;
    right: 0;
    color: var(--blue-deep);
    font-size: .75rem;
    font-weight: 600;
    text-decoration: none;
}

.forgot-password-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.control {
    position: relative;
    display: flex;
    min-height: 50px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--field-shadow);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.control:hover:not(:focus-within) {
    border-color: oklch(81% .025 242);
}

.control:focus-within {
    border-color: var(--blue);
    box-shadow: var(--focus-ring), var(--field-shadow);
}

.control > svg {
    width: 18px;
    margin-left: 15px;
    flex: 0 0 auto;
    color: oklch(58% .035 248);
}

.control input {
    width: 100%;
    height: 48px;
    min-width: 0;
    padding: 0 13px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: .83rem;
}

.control input::placeholder {
    color: oklch(67% .02 248);
}

.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px var(--paper) inset;
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
}

.field.invalid .control {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px oklch(55% .19 25 / .09);
}

.field-error {
    display: block;
    min-height: 17px;
    padding-top: 5px;
    color: var(--danger);
    font-size: .72rem;
}

.password-toggle {
    display: grid;
    width: 44px;
    height: 44px;
    margin-right: 3px;
    flex: 0 0 auto;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--quiet);
    color: var(--ink);
}

.password-toggle:focus-visible,
.primary-button:focus-visible,
.microsoft-button:focus-visible {
    outline: 3px solid oklch(55% .14 238 / .24);
    outline-offset: 2px;
}

.password-toggle svg {
    width: 18px;
}

.eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
    display: block;
}

.primary-button,
.microsoft-button {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 54px;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease,
        box-shadow 180ms ease, transform 120ms ease;
}

.primary-button {
    overflow: hidden;
    border: 1px solid var(--blue-deep);
    background: var(--blue);
    box-shadow: 0 8px 18px oklch(47% .13 240 / .18);
    color: oklch(98% .004 240);
}

.primary-button:hover {
    background: var(--blue-deep);
    box-shadow: 0 10px 22px oklch(47% .13 240 / .23);
}

.primary-button:active,
.microsoft-button:active {
    transform: translateY(1px);
}

.primary-button:disabled {
    cursor: wait;
    background: oklch(62% .075 238);
    box-shadow: none;
}

.microsoft-button:disabled,
.secondary-button:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.primary-button > svg {
    position: absolute;
    right: 17px;
    width: 16px;
}

.signin-loader {
    width: 20px;
    height: 20px;
    border: 2px solid oklch(98% .004 240 / .35);
    border-top-color: oklch(98% .004 240);
    border-radius: 50%;
    animation: spin 750ms linear infinite;
}

.auth-message {
    display: grid;
    min-height: 50px;
    margin-top: 12px;
    padding: 10px 10px 10px 12px;
    grid-template-columns: 26px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 9px;
    border: 1px solid oklch(55% .19 25 / .26);
    border-radius: 7px;
    background: oklch(97% .018 25);
    color: oklch(42% .15 25);
}

.auth-message[hidden] {
    display: none;
}

.auth-message-icon {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    background: oklch(91% .045 25);
}

.auth-message-icon svg {
    width: 15px;
    stroke-width: 2;
}

.auth-message p {
    margin: 0;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.45;
}

.auth-message button {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: oklch(48% .11 25);
    cursor: pointer;
}

.auth-message button:hover {
    background: oklch(91% .04 25);
}

.auth-message button:focus-visible {
    outline: 2px solid oklch(55% .19 25 / .35);
    outline-offset: 1px;
}

.auth-message button svg {
    width: 15px;
}

.divider {
    display: flex;
    margin: 24px 0;
    align-items: center;
    gap: 13px;
    color: oklch(59% .025 248);
    font-size: .72rem;
}

.divider::before,
.divider::after {
    height: 1px;
    flex: 1;
    background: var(--border);
    content: "";
}

.microsoft-button {
    gap: 11px;
    border: 1px solid var(--border);
    background: var(--paper);
    color: var(--ink);
    box-shadow: var(--field-shadow);
}

.microsoft-button:hover {
    border-color: oklch(78% .025 245);
    background: var(--quiet);
}

.microsoft-mark {
    display: grid;
    width: 16px;
    height: 16px;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
}

.microsoft-mark i:nth-child(1) { background: #f35325; }
.microsoft-mark i:nth-child(2) { background: #81bc06; }
.microsoft-mark i:nth-child(3) { background: #05a6f0; }
.microsoft-mark i:nth-child(4) { background: #ffba08; }

.terms {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .72rem;
    text-align: center;
}

.terms a {
    color: var(--ink);
    font-weight: 600;
    text-underline-offset: 2px;
}

.auth-footer {
    color: oklch(61% .025 248);
}

.recovery-wrap {
    max-width: 500px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 34px;
    align-items: center;
    gap: 7px;
    color: var(--blue-deep);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link svg {
    width: 16px;
    transition: transform 160ms var(--ease-out);
}

.back-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.back-link:hover svg {
    transform: translateX(-2px);
}

.recovery-heading .recovery-eyebrow {
    margin-bottom: 10px;
    color: var(--blue-deep);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.recovery-heading > p:last-child {
    max-width: 47ch;
    margin-bottom: 34px;
    line-height: 1.6;
}

.recovery-note {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.55;
}

.recovery-success {
    position: relative;
    display: grid;
    padding: 24px 24px 24px 28px;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    overflow: hidden;
    border: 1px solid oklch(87% .025 155);
    border-radius: 10px;
    background: var(--paper);
    box-shadow: 0 12px 32px oklch(24% .035 250 / .07);
}

.recovery-success::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: oklch(62% .14 155);
    content: "";
}

.recovery-success[hidden] {
    display: none;
}

.recovery-success-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid oklch(84% .07 155);
    border-radius: 50%;
    background: oklch(95% .04 155);
    color: oklch(43% .11 155);
}

.recovery-success-icon svg {
    width: 21px;
    stroke-width: 2.2;
}

.recovery-success-label {
    margin: 1px 0 7px;
    color: oklch(43% .11 155);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.recovery-success h3 {
    margin: 0 0 7px;
    color: var(--ink);
    font-size: 1.22rem;
    letter-spacing: 0;
}

.recovery-success div > p:last-child {
    margin: 0;
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.6;
}

.recovery-return {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    min-height: 40px;
    margin-top: 18px;
    padding: 0 16px;
    align-items: center;
    justify-content: center;
    border-color: oklch(82% .025 242);
    background: var(--paper);
    box-shadow: var(--field-shadow);
    font-size: .76rem;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
}

.recovery-return:hover {
    border-color: oklch(74% .04 240);
    background: var(--quiet);
}

.recovery-return:focus-visible {
    outline: 3px solid oklch(55% .14 238 / .2);
    outline-offset: 2px;
}

.reset-wrap .back-link {
    margin-bottom: 24px;
}

.reset-wrap .recovery-heading > p:last-child {
    margin-bottom: 24px;
}

.reset-wrap .field {
    margin-bottom: 16px;
}

.password-meter {
    height: 3px;
    margin: 8px 1px 0;
    overflow: hidden;
    border-radius: 2px;
    background: var(--border);
}

.password-meter span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
    transition: width 180ms var(--ease-out), background 180ms ease;
}

.password-meter span[data-score="2"],
.password-meter span[data-score="3"] {
    background: oklch(67% .14 75);
}

.password-meter span[data-score="4"],
.password-meter span[data-score="5"] {
    background: oklch(58% .13 155);
}

.password-guidance {
    margin: 7px 1px 0;
    color: var(--muted);
    font-size: .68rem;
    line-height: 1.45;
}

.twofa-dialog {
    width: min(calc(100vw - 32px), 440px);
    padding: 0;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 28px 80px oklch(15% .04 250 / .3);
    color: var(--ink);
    opacity: 0;
    transform: translateY(8px) scale(.985);
    transition:
        opacity 180ms ease,
        transform 220ms var(--ease-out),
        overlay 180ms ease allow-discrete,
        display 180ms ease allow-discrete;
}

.twofa-dialog[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@starting-style {
    .twofa-dialog[open] {
        opacity: 0;
        transform: translateY(8px) scale(.985);
    }
}

.twofa-dialog::backdrop {
    background: oklch(13% .035 250 / .58);
    opacity: 0;
    transition:
        opacity 180ms ease,
        overlay 180ms ease allow-discrete,
        display 180ms ease allow-discrete;
}

.twofa-dialog[open]::backdrop {
    opacity: 1;
}

@starting-style {
    .twofa-dialog[open]::backdrop {
        opacity: 0;
    }
}

.twofa-shell {
    padding: 28px;
}

.twofa-icon {
    display: grid;
    width: 38px;
    height: 38px;
    margin-bottom: 20px;
    place-items: center;
    border-radius: 8px;
    background: var(--blue-soft);
    color: var(--blue-deep);
}

.twofa-icon svg {
    width: 19px;
}

.twofa-heading > p {
    margin: 0 0 7px;
    color: var(--blue-deep);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.twofa-heading h2 {
    margin: 0 0 7px;
    font-size: 1.45rem;
    letter-spacing: 0;
}

.twofa-heading > span {
    color: var(--muted);
    font-size: .82rem;
}

.twofa-inputs {
    display: grid;
    margin: 26px 0 14px;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.twofa-input {
    width: 100%;
    min-width: 0;
    height: 50px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    outline: 0;
    background: var(--paper);
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
}

.twofa-input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px oklch(55% .14 238 / .14);
}

.twofa-meta {
    min-height: 38px;
    color: var(--muted);
    font-size: .75rem;
}

.twofa-error {
    display: block;
    margin-top: 5px;
    color: var(--danger);
    font-weight: 600;
}

.twofa-actions {
    display: grid;
    margin-top: 20px;
    grid-template-columns: .8fr 1.2fr;
    gap: 10px;
}

.secondary-button {
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}

.secondary-button:hover {
    background: var(--quiet);
}

.secondary-button:focus-visible {
    outline: 3px solid oklch(55% .14 238 / .2);
    outline-offset: 2px;
}

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

@media (max-height: 780px) and (min-width: 901px) {
    .stage-copy {
        margin-top: auto;
        margin-bottom: 24px;
    }

    .stage-copy h1 {
        font-size: clamp(2.4rem, 3.7vw, 3.8rem);
    }

    .auth-heading p {
        margin-bottom: 24px;
    }

    .field {
        margin-bottom: 14px;
    }

    .divider {
        margin: 17px 0;
    }
}

@media (max-width: 1100px) {
    .login-shell {
        grid-template-columns: minmax(470px, 1fr) minmax(410px, .9fr);
    }

    .signal-stage {
        padding-inline: 38px;
    }

}

@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }

    .login-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .signal-stage {
        display: none;
    }

    .auth-stage {
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
            max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    }

    .app-version {
        right: max(24px, env(safe-area-inset-right));
        bottom: max(20px, env(safe-area-inset-bottom));
    }

    .mobile-brand {
        display: block;
        height: 50px;
        margin-top: 8px;
    }

    .mobile-brand img {
        width: 204px;
        height: auto;
        user-select: none;
    }

    .auth-wrap {
        margin-block: auto;
        padding-block: 42px;
    }
}

@media (max-width: 480px) {
    .auth-stage {
        padding-inline: max(20px, env(safe-area-inset-left));
    }

    .auth-wrap {
        padding-block: 36px;
    }

    .auth-heading h2 {
        font-size: 1.75rem;
    }

    .auth-heading p {
        margin-bottom: 28px;
        font-size: .9rem;
    }

    .field label,
    .forgot-password-link,
    .primary-button,
    .microsoft-button {
        font-size: .875rem;
    }

    .control input {
        font-size: .9rem;
    }

    .field-error,
    .auth-message p,
    .divider,
    .terms {
        font-size: .8rem;
    }

    .auth-footer {
        font-size: .8rem;
    }

    .back-link {
        margin-bottom: 28px;
        font-size: .875rem;
    }

    .recovery-note,
    .recovery-success div > p:last-child {
        font-size: .8rem;
    }

    .recovery-success {
        padding: 22px 20px 22px 24px;
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 14px;
    }

    .recovery-success-icon {
        width: 40px;
        height: 40px;
    }

    .password-guidance {
        font-size: .76rem;
    }

    .auth-message button {
        width: 44px;
        height: 44px;
    }

    .twofa-inputs {
        gap: 5px;
    }

    .twofa-shell {
        padding: 24px 20px;
    }

    .twofa-input {
        height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}
