/* Hallmark · macrostructure: Authentication Utility · component scope: MITELI Time authentication · tone: formal minimal · palette: MITELI violet · reference: MITELI Billing · contrast: pass (40–41) · nav: none · footer: none · slop: pass (42–49) · mobile: pass (34, 49–57) */
/* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V5 */

:root {
    --auth-font-body: "Noto Sans JP", sans-serif;
    --auth-paper: oklch(97% 0.008 315);
    --auth-surface: oklch(99% 0.004 315);
    --auth-surface-hover: oklch(96% 0.01 315);
    --auth-ink: oklch(20% 0.018 300);
    --auth-text: oklch(34% 0.016 300);
    --auth-muted: oklch(45% 0.014 300);
    --auth-border: oklch(64% 0.026 300);
    --auth-border-strong: oklch(58% 0.035 300);
    --auth-accent: oklch(31% 0.12 313);
    --auth-accent-hover: oklch(25% 0.11 313);
    --auth-accent-ink: oklch(98% 0.006 315);
    --auth-focus: oklch(52% 0.2 314);
    --auth-error: oklch(47% 0.17 25);
    --auth-error-surface: oklch(96% 0.025 25);
    --auth-error-border: oklch(62% 0.12 25);
    --auth-space-3xs: 0.125rem;
    --auth-space-xs: 0.5rem;
    --auth-space-sm: 0.75rem;
    --auth-space-md: 1rem;
    --auth-space-lg: 1.5rem;
    --auth-space-xl: 2.5rem;
    --auth-space-2xl: 4rem;
    --auth-card-padding: 2rem;
    --auth-radius-sm: 0.25rem;
    --auth-radius-md: 0.5rem;
    --auth-duration: 150ms;
    --auth-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html,
body {
    overflow-x: clip;
}

html {
    font-size: 16px;
}

body.login-page {
    display: block;
    min-width: 20rem;
    min-height: 100svh;
    background: var(--auth-paper);
    color: var(--auth-text);
    font-family: var(--auth-font-body);
    font-size: 1rem;
    line-height: 1.6;
}

.auth-shell {
    display: grid;
    width: 100%;
    min-height: 100svh;
    place-items: start center;
    padding-block: max(var(--auth-space-xl), env(safe-area-inset-top)) max(var(--auth-space-xl), env(safe-area-inset-bottom));
    padding-inline: max(var(--auth-space-md), env(safe-area-inset-left)) max(var(--auth-space-md), env(safe-area-inset-right));
}

.auth-login {
    width: min(100%, 27.5rem);
}

.auth-login__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--auth-space-lg);
    text-align: center;
}

.auth-login__logo {
    display: block;
    width: min(100%, 16rem);
    height: auto;
}

.auth-login__product {
    margin: 0;
    color: var(--auth-ink);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.4;
}

.auth-login__card {
    width: 100%;
    margin-block-start: var(--auth-space-xl);
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-md);
    background: var(--auth-surface);
    color: var(--auth-text);
    padding: var(--auth-space-lg);
}

.auth-login__heading {
    display: grid;
    gap: var(--auth-space-xs);
}

.auth-login__heading h1,
.auth-login__heading p {
    margin: 0;
}

.auth-login__heading h1 {
    min-width: 0;
    color: var(--auth-ink);
    font-size: 1.5625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.auth-login__heading p {
    color: var(--auth-muted);
    font-size: 0.875rem;
}

.auth-login__error {
    display: flex;
    align-items: flex-start;
    gap: var(--auth-space-sm);
    margin-block-start: var(--auth-space-lg);
    border: 1px solid var(--auth-error-border);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-error-surface);
    color: var(--auth-error);
    padding: var(--auth-space-sm) var(--auth-space-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.6;
}

.auth-login__error .lucide-icon-frame {
    flex: 0 0 auto;
    margin-block-start: var(--auth-space-3xs);
}

.auth-login__form {
    display: grid;
    gap: var(--auth-space-lg);
    margin-block-start: var(--auth-space-lg);
}

.auth-field {
    display: grid;
    gap: var(--auth-space-xs);
}

.auth-field label {
    color: var(--auth-ink);
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-field__input {
    box-sizing: border-box;
    width: 100%;
    height: 3rem;
    border: 1px solid var(--auth-border-strong);
    border-radius: var(--auth-radius-sm);
    outline: 2px solid transparent;
    outline-offset: 1px;
    background: var(--auth-surface);
    color: var(--auth-ink);
    padding-inline: var(--auth-space-sm);
    font: inherit;
    line-height: 1.5;
    transition: background-color var(--auth-duration) var(--auth-ease-out), border-color var(--auth-duration) var(--auth-ease-out);
}

.auth-field__input:focus-visible {
    border-color: var(--auth-accent);
    outline-color: var(--auth-focus);
}

.auth-field__input.is-invalid {
    border-color: var(--auth-error);
}

.auth-field__input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background: var(--auth-surface-hover);
    color: var(--auth-muted);
}

.auth-remember {
    display: inline-flex;
    width: fit-content;
    min-height: 2.75rem;
    align-items: center;
    gap: var(--auth-space-sm);
    color: var(--auth-text);
    cursor: pointer;
    font-size: 0.875rem;
}

.auth-remember input {
    width: 1.25rem;
    height: 1.25rem;
    margin: 0;
    accent-color: var(--auth-accent);
}

.auth-remember input:focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 2px;
}

.auth-remember:has(input:disabled),
.auth-remember input:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.auth-login__submit {
    display: inline-flex;
    width: 100%;
    height: 3rem;
    align-items: center;
    justify-content: center;
    gap: var(--auth-space-xs);
    border: 1px solid var(--auth-accent);
    border-radius: var(--auth-radius-sm);
    background: var(--auth-accent);
    color: var(--auth-accent-ink);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color var(--auth-duration) var(--auth-ease-out), border-color var(--auth-duration) var(--auth-ease-out), transform 100ms var(--auth-ease-out);
}

.auth-login__submit:active {
    transform: translateY(1px);
}

.auth-login__submit:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.auth-login__submit:focus-visible {
    outline: 2px solid var(--auth-surface);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--auth-focus);
}

.auth-login__foot {
    margin: var(--auth-space-lg) 0 0;
    color: var(--auth-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
}

@media (hover: hover) and (pointer: fine) {
    .auth-field__input:hover {
        background: var(--auth-surface-hover);
    }

    .auth-login__submit:hover {
        border-color: var(--auth-accent-hover);
        background: var(--auth-accent-hover);
    }
}

@media (min-width: 40rem) {
    .auth-shell {
        padding-block: var(--auth-space-2xl);
    }

    .auth-login__logo {
        width: min(100%, 19rem);
    }

    .auth-login__product {
        font-size: 1.5rem;
    }

    .auth-login__card {
        padding: var(--auth-card-padding);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-field__input,
    .auth-login__submit {
        transition-duration: 0.01ms;
    }
}
