:root {
    color-scheme: light;
    --klockin-blue: #0056d6;
    --klockin-blue-hover: #0047b4;
    --klockin-text: #111827;
    --klockin-muted: #526174;
    --klockin-field: #c9d4e2;
    --klockin-error: #a12622;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f3f6fa;
    color: var(--klockin-text);
    font: 400 1rem/1.5 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", sans-serif;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    place-items: center;
    padding: clamp(1rem, 3vw, 2.5rem);
}

.auth-card {
    width: min(100%, 29rem);
    padding: clamp(1.375rem, 6vw, 3rem);
    border-radius: 1.75rem;
    background: white;
    box-shadow: 0 20px 64px rgb(24 48 82 / 9%), 0 1px 4px rgb(24 48 82 / 5%);
}

.klockin-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    margin-bottom: 1.75rem;
    font-size: 1.375rem;
    font-weight: 750;
}

.klockin-brand img {
    display: block;
    object-fit: contain;
}

.auth-company {
    margin: -1rem 0 1.25rem;
    color: var(--klockin-muted);
    font-size: 0.875rem;
}

.auth-card h1 {
    margin: 0 0 1.375rem;
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    font-weight: 690;
    line-height: 1.15;
    text-wrap: balance;
}

.auth-description {
    margin: -0.5rem 0 1.5rem;
    color: var(--klockin-muted);
    text-wrap: pretty;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-field {
    min-width: 0;
}

.auth-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 620;
}

.auth-field input {
    display: block;
    width: 100%;
    min-height: 3.125rem;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--klockin-field);
    border-radius: 0.75rem;
    background: #fbfcfe;
    color: inherit;
    font: inherit;
}

.auth-field input:focus {
    border-color: var(--klockin-blue);
    outline: 2px solid rgb(0 86 214 / 22%);
    outline-offset: 1px;
}

.auth-field input[aria-invalid="true"],
.auth-field:has(.errorlist) input {
    border-color: var(--klockin-error);
}

.auth-password {
    position: relative;
}

.auth-password input {
    padding-right: 4.75rem;
}

.auth-password-toggle {
    position: absolute;
    top: 0.25rem;
    right: 0.35rem;
    bottom: 0.25rem;
    padding: 0 0.5rem;
    border: 0;
    border-radius: 0.45rem;
    background: none;
    color: var(--klockin-blue);
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 620;
}

.auth-card a,
.auth-setup summary {
    color: var(--klockin-blue);
    font-weight: 620;
    text-underline-offset: 0.2em;
}

.auth-form-link {
    justify-self: end;
    font-size: 0.875rem;
}

.auth-submit,
.auth-card .auth-submit--link {
    display: grid;
    width: 100%;
    min-height: 3.125rem;
    place-items: center;
    padding: 0.65rem 1rem;
    border: 0;
    border-radius: 0.75rem;
    background: var(--klockin-blue);
    color: white;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    text-align: center;
    text-decoration: none;
    transition: background-color 150ms ease-out;
}

.auth-submit:hover,
.auth-card .auth-submit--link:hover {
    background: var(--klockin-blue-hover);
}

.auth-card :is(a, button, summary):focus-visible {
    outline: 2px solid var(--klockin-blue);
    outline-offset: 3px;
}

.auth-back,
.auth-setup {
    display: block;
    margin-top: 1.15rem;
    font-size: 0.875rem;
}

.auth-setup details {
    margin-top: 0.65rem;
}

.auth-setup summary {
    width: fit-content;
    cursor: pointer;
}

.auth-setup .auth-form,
.auth-messages {
    margin-top: 0.85rem;
}

.auth-message {
    margin: 0 0 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    background: #edf4fc;
    color: #23496d;
    font-size: 0.875rem;
}

.auth-message--error,
.auth-message--danger,
.auth-message--warning {
    background: #fef2f2;
    color: var(--klockin-error);
}

.auth-message--success {
    background: #ecfdf3;
    color: #166534;
}

.auth-error,
.auth-field .errorlist {
    margin: 0.375rem 0 0;
    color: var(--klockin-error);
    font-size: 0.8125rem;
}

.auth-footer {
    margin-top: 1.625rem;
    padding-top: 1rem;
    border-top: 1px solid #e8eef6;
    color: var(--klockin-muted);
    font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit {
        transition: none;
    }
}
