/* ============================================
   AUTH PAGE — adapted from conciliador pattern
   Uses the project's existing CSS variables
   ============================================ */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, var(--brand-weak) 0, transparent 38%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg) 100%);
}

.auth-shell {
    min-height: 100vh;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 32px;
}

.auth-panel {
    display: none;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.auth-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 20px 40px -28px var(--brand);
}

.auth-brand-copy {
    color: var(--text);
}

.auth-brand-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.auth-panel-title {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -0.04em;
    font-weight: 600;
}

.auth-panel-body {
    max-width: 480px;
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.auth-card-wrap {
    width: 100%;
    max-width: 520px;
    justify-self: center;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.auth-card-title {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 24px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.auth-card-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.auth-field {
    margin-bottom: 30px;
}

.auth-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-input {
    padding-right: 44px !important;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.auth-password-toggle:hover {
    background: var(--brand-weak);
    color: var(--brand);
}

.auth-password-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.auth-error {
    margin-top: 8px;
    color: var(--error);
    font-size: 13px;
}

.auth-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--error) 20%, transparent);
    background: color-mix(in srgb, var(--error) 8%, transparent);
    color: var(--error);
    font-size: 13px;
    line-height: 1.45;
}

.auth-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 32px;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.auth-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--brand);
}

.auth-link {
    color: var(--brand);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

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

.auth-submit {
    width: 100%;
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.auth-submit:hover {
    filter: brightness(1.05);
}

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

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: none;
}

.auth-theme-toggle {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
    box-shadow: var(--shadow);
}

.auth-theme-toggle:hover {
    background: var(--brand-weak);
    color: var(--brand);
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr) minmax(420px, 520px);
        padding: 40px 24px;
    }

    .auth-panel {
        display: block;
        padding-right: 24px;
    }

    .auth-card-wrap {
        justify-self: end;
    }
}

/* ============================================
   PASSWORD STRENGTH CHECKLIST — cosmetic only,
   server-side validate_password() is the real
   boundary (sdd_source_of_truth_user_provisioning.md)
   ============================================ */

[x-cloak] { display: none !important; }

.auth-strength-bar-track {
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
    margin: 10px 0 12px;
}

.auth-strength-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--error);
    width: 0%;
    transition: width 0.2s ease, background-color 0.2s ease;
}

.auth-strength-checklist {
    list-style: none;
    margin: 0 0 4px;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.auth-strength-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--muted);
}

.auth-strength-item.is-met {
    color: var(--success);
}

.auth-strength-item .auth-strength-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    line-height: 1;
    color: transparent;
}

.auth-strength-item.is-met .auth-strength-dot {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}