:root {
    color-scheme: light;
    --radius: 0.625rem;
    --background: oklch(1 0 0);
    --foreground: oklch(0.145 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.145 0 0);
    --primary: oklch(0.205 0 0);
    --primary-foreground: oklch(0.985 0 0);
    --secondary: oklch(0.97 0 0);
    --secondary-foreground: oklch(0.205 0 0);
    --muted: oklch(0.97 0 0);
    --muted-foreground: oklch(0.556 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.922 0 0);
    --input: oklch(0.922 0 0);
    --ring: oklch(0.708 0 0);
    --success: oklch(0.45 0.12 155);
    --success-background: oklch(0.97 0.03 155);
    color: var(--foreground);
    background: var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

body {
    min-width: 20rem;
    min-height: 100vh;
    display: grid;
    margin: 0;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

.auth-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1rem;
    background:
            radial-gradient(circle at top, oklch(0.97 0 0) 0, transparent 28rem),
            linear-gradient(180deg, var(--background), var(--muted));
}

.auth-card {
    display: flex;
    width: min(27rem, 100%);
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
    border: 1px solid color-mix(in oklch, var(--foreground) 10%, transparent);
    border-radius: calc(var(--radius) + 0.25rem);
    background: var(--card);
    color: var(--card-foreground);
    box-shadow: 0 1px 2px oklch(0 0 0 / 0.05);
}

.auth-card-header {
    display: grid;
    gap: 0.25rem;
    padding: 1.25rem 1.25rem 0;
}

.auth-topline,
.auth-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.auth-brand {
    margin: 0 0 0.25rem;
    color: var(--muted-foreground);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25rem;
}

h1 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5rem;
    letter-spacing: 0;
}

.auth-description {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.auth-card-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 1.25rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
}

.auth-field-row label {
    font: inherit;
}

.auth-help {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.125rem;
}

.auth-field input,
.auth-button {
    width: 100%;
    height: 2rem;
    border-radius: calc(var(--radius) + 0.125rem);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25rem;
    outline: none;
    transition:
            background-color 150ms ease,
            border-color 150ms ease,
            box-shadow 150ms ease,
            color 150ms ease,
            transform 150ms ease;
}

.auth-field input {
    min-width: 0;
    border: 1px solid var(--input);
    background: transparent;
    color: var(--foreground);
    padding: 0.25rem 0.625rem;
}

.auth-input-action {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-action input {
    padding-right: 4.5rem;
}

.auth-input-button {
    position: absolute;
    right: 0.25rem;
    height: 1.5rem;
    border: 0;
    border-radius: calc(var(--radius) - 0.125rem);
    background: transparent;
    color: var(--muted-foreground);
    cursor: pointer;
    padding: 0 0.5rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
}

.auth-input-button:hover {
    background: var(--muted);
    color: var(--foreground);
}

.auth-input-button:focus-visible {
    box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring) 50%, transparent);
}

.auth-field input:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.auth-field input[aria-invalid="true"] {
    border-color: var(--destructive);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--destructive) 20%, transparent);
}

.auth-button {
    border: 1px solid transparent;
    background: var(--primary);
    color: var(--primary-foreground);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

.auth-button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.auth-button:hover {
    background: color-mix(in oklch, var(--primary) 88%, var(--background));
}

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

.auth-button:focus-visible,
.auth-card-footer a:focus-visible {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent);
}

.auth-alert {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 0.125rem);
    background: var(--muted);
    color: var(--foreground);
    padding: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.auth-alert-error,
.auth-field-error {
    color: var(--destructive);
}

.auth-alert-error {
    border-color: color-mix(in oklch, var(--destructive) 30%, transparent);
    background: color-mix(in oklch, var(--destructive) 10%, var(--background));
}

.auth-alert-success {
    border-color: color-mix(in oklch, var(--success) 30%, transparent);
    background: var(--success-background);
    color: var(--success);
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.25rem;
}

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    margin: 0.125rem 0 0;
    accent-color: var(--primary);
}

.auth-checkbox-invalid {
    color: var(--destructive);
}

.auth-checkbox a,
.auth-link {
    color: var(--foreground);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: color-mix(in oklch, var(--foreground) 25%, transparent);
    text-underline-offset: 0.25rem;
}

.auth-checkbox a:hover,
.auth-link:hover {
    text-decoration-color: var(--foreground);
}

.auth-link {
    font-size: 0.875rem;
    line-height: 1.25rem;
    white-space: nowrap;
}

.auth-field-error {
    font-size: 0.8rem;
    line-height: 1.125rem;
}

.auth-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border);
    background: color-mix(in oklch, var(--muted) 50%, transparent);
    padding: 1rem 1.25rem;
}

.auth-card-footer p {
    margin: 0;
    color: var(--muted-foreground);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.auth-card-footer a {
    display: inline-flex;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) + 0.125rem);
    background: var(--background);
    color: var(--foreground);
    padding: 0.25rem 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25rem;
    text-decoration: none;
    transition:
            background-color 150ms ease,
            color 150ms ease,
            box-shadow 150ms ease;
}

.auth-card-footer a:hover {
    background: var(--muted);
}

@media (max-width: 30rem) {
    .auth-shell {
        align-items: start;
        padding-top: 3rem;
    }
}
