* {
    box-sizing: border-box;
}

/* Auth-/Account-Pages: Aliase auf zentrale Tokens. */
:root {
    --bg:           var(--neutral-bg);
    --text:         var(--neutral-text);
    --muted:        var(--neutral-text-muted);
    --border:       var(--neutral-border);
    --surface:      var(--neutral-surface);
    --primary:      var(--brand-primary);
    --accent:       var(--brand-accent);
    --error:        var(--state-danger-strong);
    --error-bg:     var(--state-danger-bg);
    --error-border: var(--state-danger-border);
}

body.login-page {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(#e3e8ef 1px, transparent 1px);
    background-size: 24px 24px;
}

.auth-header {
    padding: 2rem 1rem 1rem;
    display: flex;
    justify-content: center;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.brand-logo {
    height: 40px;
    width: auto;
}

.auth-main {
    padding: 1rem;
    display: flex;
    justify-content: center;
}

.login-card {
    width: min(480px, 100%);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 14px 36px rgba(16, 42, 67, 0.08);
    padding: 1.6rem;
}

.login-card-head {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-card-head h1 {
    margin: 0;
    /* Konsistenz mit .account-card__head h1 — beide Login-Card-Varianten
       teilen sich jetzt eine Heading-Hierarchie. */
    font-size: clamp(1.55rem, 3.2vw, 1.85rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.login-card-head p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.login-error-banner {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    margin-bottom: 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--error-border);
    background: var(--error-bg);
}

.login-error-banner__icon {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    display: grid;
    place-items: center;
    line-height: 1;
}

.login-error-banner__body {
    min-width: 0;
}

.login-error-banner__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--error);
}

.login-error-banner__text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #b91c1c;
}

.field--error label {
    color: var(--error);
}

.input-wrap--error {
    border: 2px solid var(--error);
    background: #fffafa;
}

.input-wrap--error:focus-within {
    border: 2px solid var(--error);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.field--error .input-icon {
    color: var(--error);
}

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

.field label {
    display: block;
    font-size: 0.93rem;
    font-weight: 600;
    margin-bottom: 0.36rem;
}

.forgot-link {
    display: block;
    text-align: left;
    margin-top: 0.35rem;
    color: #5d6580;
    text-decoration: none;
    font-size: 0.8rem;
}

.forgot-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.input-wrap {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-primary-soft);
}

.input-wrap input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    padding: 0.78rem 0.9rem;
}

.with-icon {
    display: flex;
    align-items: center;
}

.input-icon {
    width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #8a93a8;
    font-size: 0.96rem;
    flex-shrink: 0;
}

.input-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.with-icon input {
    padding-left: 0;
}

.with-button {
    padding-right: 0.25rem;
}

.toggle-password {
    border: 0;
    background: transparent;
    color: #7c859c;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
}

.toggle-password:hover {
    background: var(--brand-primary-soft);
}

.submit-btn {
    margin-top: 0.45rem;
    width: 100%;
    border: 0;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: #fff;
    background: var(--brand-gradient);
    box-shadow: var(--shadow-brand);
    cursor: pointer;
    transition: filter 0.15s, box-shadow 0.15s;
}

.submit-btn:hover {
    background: var(--brand-gradient-hover);
    filter: brightness(1.02);
}

.submit-btn--danger {
    background: var(--state-danger-strong);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2), 0 6px 16px rgba(239, 68, 68, 0.18);
}

.submit-btn--danger:hover {
    background: #B82929;
}

.divider {
    margin: 1.2rem 0 1rem;
    position: relative;
    text-align: center;
}

.divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    border-top: 1px solid var(--border);
}

.divider span {
    position: relative;
    background: var(--surface);
    color: var(--muted);
    padding: 0 0.55rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.social-logins {
    display: grid;
    gap: 0.65rem;
}

.social-btn {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    background: #fff;
}

.social-btn:hover {
    border-color: #b8c0cf;
    background: #f9fafc;
}

.social-btn svg {
    width: 18px;
    height: 18px;
}

.pw-success-banner {
    padding: 0.85rem 1rem;
    margin-bottom: 1.1rem;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.9rem;
    line-height: 1.45;
}

.pw-success-banner p {
    margin: 0;
}

.auth-footer {
    margin-top: 1.15rem;
    text-align: center;
    color: var(--muted);
}

.auth-footer a {
    color: var(--text);
    font-weight: 700;
}

/* ============================================================
   Account-Pages (Kontoeinstellungen, Account-Billing)
   Back-Pill oben, einheitliche
   Sektionen mit Icon + Titel + Beschreibung + Brand-CTA.
   ============================================================ */
body.account-page {
    background-color: var(--bg);
}

.account-card {
    width: min(560px, 100%);
    padding: 1.25rem 1.25rem 1.5rem;
}

.account-card__nav {
    margin-bottom: 1rem;
}

.account-card__head {
    margin-bottom: 1.5rem;
}

.account-card__head h1 {
    margin: 0 0 0.25rem;
    /* Selbe Hierarchie wie .login-card-head h1 — siehe oben. */
    font-size: clamp(1.55rem, 3.2vw, 1.85rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--neutral-text-strong);
}

.account-card__subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
}

.account-section {
    padding: 1.25rem;
    background: var(--neutral-surface);
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-lg);
    margin-bottom: 0.875rem;
    box-shadow: 0 1px 2px rgba(11, 18, 32, 0.03);
}

.account-section:last-child {
    margin-bottom: 0;
}

.account-section--danger {
    border-color: #FCD9D9;
    background: #FFFBFB;
}

.account-section__title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--neutral-text-strong);
}

.account-section__title--danger {
    color: var(--state-danger);
}

.account-section__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--brand-primary);
    flex-shrink: 0;
}

.account-section__title--danger .account-section__icon {
    color: var(--state-danger);
}

.account-section__desc {
    margin: 0 0 0.875rem;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.45;
}

.account-section .submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
}

