:root {
    --background: #f7f7f7;
    --foreground: #171717;
    --card: #ffffff;
    --muted-foreground: #6b7280;
    --border: #ededed;
    --input: #ededed;
    --primary: #3f50b5;
    --primary-hover: #34449d;
    --primary-foreground: #ffffff;
    --destructive: #dc2626;
    --ring: rgba(63, 80, 181, 0.25);
    --radius: 12px;
    --radius-card: 16px;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--foreground);
    background: radial-gradient(circle at top, #ffffff 0%, #f3f4f6 48%, #eceff3 100%);
    font-family: "Inter", sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.04), 0 1px 2px rgb(0 0 0 / 0.04);
}

.error-card {
    max-width: 560px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.brand-logo {
    width: 42px;
    height: 42px;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--foreground);
}

.error-illustration-wrap {
    margin: 0 auto 18px;
}

.error-illustration {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
}

.auth-title {
    margin: 0 0 8px;
    color: var(--foreground);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.auth-subtitle {
    margin: 0 0 20px;
    color: var(--muted-foreground);
    text-align: center;
    font-size: 0.95rem;
}

.centered {
    text-align: center;
}

.eyebrow {
    margin: 0 0 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 6px;
}

.field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--foreground);
}

.field-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--input);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--foreground);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.field-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

select.field-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%),
        linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
    background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 36px;
}

.btn-primary {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: var(--radius);
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}

.alert-error {
    margin-bottom: 16px;
    border-radius: var(--radius);
    padding: 10px 12px;
    border: 1px solid rgb(220 38 38 / 0.2);
    background: rgb(220 38 38 / 0.08);
    color: var(--destructive);
    font-size: 0.875rem;
    text-align: center;
}

.alert-success {
    margin-bottom: 16px;
    border-radius: var(--radius);
    padding: 10px 12px;
    border: 1px solid rgb(22 163 74 / 0.2);
    background: rgb(22 163 74 / 0.08);
    color: #15803d;
    font-size: 0.875rem;
    text-align: center;
}

.alert-info {
    margin-bottom: 16px;
    border-radius: var(--radius);
    padding: 12px 14px;
    border: 1px solid rgb(63 80 181 / 0.16);
    background: rgb(63 80 181 / 0.06);
    color: #243277;
    font-size: 0.875rem;
    line-height: 1.5;
}

.auth-footer {
    margin-top: 16px;
    color: var(--muted-foreground);
    text-align: center;
    font-size: 0.875rem;
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: 20px;
    text-align: center;
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-link-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
}

.auth-message {
    margin: 0;
    color: var(--foreground);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

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

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

@media (max-width: 640px) {
    .auth-card {
        padding: 24px;
    }

    .error-illustration {
        max-width: 260px;
    }
}
