/* Profil / Anmeldeformular */

/* -------------------------------------------------------------------------
   Farben – zentral an einer Stelle gesammelt
   ------------------------------------------------------------------------- */
:root {
    /* Text */
    --profile-text: #1a1a1a;
    --profile-text-muted: #8a8a87;
    --profile-text-label: #444442;
    --profile-placeholder: #b4b4b0;

    /* Flächen */
    --profile-white: #ffffff;
    --profile-hover-bg: #f0f0ee;
    --profile-hover-border: #d5d5d2;
    --profile-surface: #f2f2f0;
    --profile-border: #e6e6e3;
    --profile-input-bg: #f9f9f7;

    /* Overlays & Schatten */
    --profile-overlay-bg: rgba(20, 20, 20, 0.5);
    --profile-modal-shadow: rgba(0, 0, 0, 0.3);
    --profile-avatar-overlay: rgba(0, 0, 0, 0.35);
    --profile-focus-ring: rgba(21, 144, 121, 0.14);
    --profile-submit-hover-shadow: rgba(21, 144, 121, 0.45);

    /* Status */
    --profile-error: #e5484d;
    --profile-danger: #e5484d;
    --profile-danger-hover: #d13438;
    --profile-danger-bg: #fdecec;
    --profile-danger-shadow: rgba(229, 72, 77, 0.22);

    /* Erfolgs-Häkchen (grün) */
    --profile-success: #159079;
    --profile-success-bg: #c8ebe4;
    --profile-success-glow: rgba(21, 144, 121, 0.42);
    --profile-success-glow-transparent: rgba(21, 144, 121, 0);
    --profile-success-shadow: rgba(21, 144, 121, 0.45);
    --profile-success-shadow-strong: rgba(21, 144, 121, 0.5);
}

/* Dark Mode: Profil-Fenster (Passwort, 2FA, Konto löschen …) dunkel färben */
body.dark {
    --profile-text: #f2f2f4;
    --profile-text-muted: #9a9aa2;
    --profile-text-label: #c8c8d0;
    --profile-placeholder: #6f6f78;

    --profile-white: #1e1e1e;
    --profile-hover-bg: #2a2a2a;
    --profile-hover-border: rgba(255, 255, 255, 0.16);
    --profile-surface: #262626;
    --profile-border: rgba(255, 255, 255, 0.08);
    --profile-input-bg: #262626;

    --profile-modal-shadow: rgba(0, 0, 0, 0.14);
    --profile-danger-bg: rgba(229, 72, 77, 0.14);
}

/* Submit-Button: Text bleibt weiss, Leuchten dezenter */
body.dark .auth-submit,
body.dark .auth-submit-danger {
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}

.profile {
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.profile:hover {
    background: var(--profile-hover-bg);
    border-color: var(--profile-hover-border);
}

.auth-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--profile-overlay-bg);
    backdrop-filter: blur(2px);
    z-index: 100;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.auth-overlay.open {
    display: flex;
    animation: authFade 0.2s ease;
}

@keyframes authFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 20px;
    padding: 48px 48px 40px;
    box-sizing: border-box;
    background: var(--profile-white);
    border-radius: 28px;
    box-shadow: 0 30px 80px var(--profile-modal-shadow);
    animation: authPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@keyframes authPop {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-close {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: var(--profile-surface);
    color: var(--profile-text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.auth-close:hover {
    background: var(--profile-border);
    color: var(--profile-text);
}

.auth-close svg {
    width: 18px;
    height: 18px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin-bottom: 24px;
    border-radius: 18px;
    background: var(--accent-gradient);
    color: var(--profile-white);
    box-shadow: 0 8px 22px var(--accent-shadow);
}

.auth-brand svg {
    width: 30px;
    height: 30px;
}

.auth-title {
    margin: 0 0 6px;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--profile-text);
}

.auth-subtitle {
    margin: 0 0 32px;
    font-size: 15px;
    color: var(--profile-text-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.auth-field span {
    font-size: 13px;
    font-weight: 600;
    color: var(--profile-text-label);
}

.auth-field input {
    height: 52px;
    padding: 0 18px;
    box-sizing: border-box;
    border: 1.5px solid var(--profile-border);
    border-radius: 14px;
    background: var(--profile-input-bg);
    font-size: 15px;
    color: var(--profile-text);
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
    color: var(--profile-placeholder);
}

.auth-field input:focus {
    border-color: var(--accent-solid);
    background: var(--profile-white);
    box-shadow: 0 0 0 4px var(--profile-focus-ring);
}

/* Verhindert, dass der Browser bei Autofill-Vorschlägen (z. B. gespeicherte
   Logins) den Hintergrund des Feldes weiss/gelb einfärbt. */
.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus,
.auth-field input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--profile-text);
    -webkit-box-shadow: 0 0 0 1000px var(--profile-input-bg) inset;
    box-shadow: 0 0 0 1000px var(--profile-input-bg) inset;
    transition: background-color 600000s 0s, color 600000s 0s;
    caret-color: var(--profile-text);
}

/* Zwei Felder nebeneinander (z. B. Arbeitszeit & Urlaubstage) */
.auth-field-row {
    display: flex;
    gap: 14px;
    width: 100%;
}

.auth-field-row .auth-field {
    flex: 1;
    min-width: 0;
}

/* Schreibgeschützte Vertragsfelder (Wochenstunden / Urlaubstage) */
.auth-field input[readonly] {
    background: var(--profile-input-bg);
    color: var(--profile-text-label);
    cursor: default;
    font-weight: 600;
}

.auth-field input[readonly]:focus {
    border-color: var(--profile-border);
    box-shadow: none;
    background: var(--profile-input-bg);
}

/* Felder nur im Registrieren-Modus sichtbar */
.auth-field-name,
.auth-field-confirm {
    display: none;
}

.auth-overlay.register .auth-field-name,
.auth-overlay.register .auth-field-confirm {
    display: flex;
}

.auth-submit {
    height: 54px;
    margin-top: 8px;
    border: none;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: var(--profile-white);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 26px var(--accent-shadow);
    transition: box-shadow 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}

.auth-submit:hover {
    filter: brightness(1.08);
    box-shadow: 0 12px 30px var(--profile-submit-hover-shadow);
}

.auth-submit:active {
    transform: scale(0.99);
}

.auth-switch {
    margin: 28px 0 0;
    text-align: center;
    font-size: 15px;
    color: var(--profile-text-muted);
}

.auth-switch-btn {
    margin-left: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-solid);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.auth-switch-btn:hover {
    opacity: 0.65;
}

/* Testphase-CTA (nur im Anmelden-Modus sichtbar) */
.auth-trial {
    margin-top: 24px;
    text-align: center;
}

.auth-divider {
    height: 1px;
    margin-bottom: 22px;
    background: linear-gradient(90deg, transparent, var(--profile-border, rgba(148, 163, 184, 0.35)), transparent);
}

.auth-trial-label {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--profile-text-muted);
}

.auth-trial-line {
    margin: 0;
    font-size: 15px;
    color: var(--profile-text-muted);
}

.auth-trial-btn {
    margin-left: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-solid);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.auth-trial-btn:hover {
    opacity: 0.65;
}

.auth-trial-emoji {
    font-size: 15px;
    line-height: 1;
}

.auth-trial-note {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--profile-text-muted);
}

/* Umschalten Anmelden <-> Registrieren:
   Login zeigt die Testphase-CTA, Registrierung den einfachen Zurück-Link. */
.auth-switch {
    display: none;
}

.auth-overlay.register .auth-switch {
    display: block;
}

.auth-overlay.register .auth-trial {
    display: none;
}

/* "Passwort vergessen?"-Link (nur im Anmelden-Modus) */
.auth-forgot {
    align-self: center;
    margin-top: -8px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-solid);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.auth-forgot:hover {
    opacity: 0.65;
}

.auth-overlay.register .auth-forgot {
    display: none;
}

/* Passwort-zurücksetzen-Fenster: Schritte umschalten */
.reset-step {
    display: none;
}

/* Kein Aufblitzen/Animation beim Öffnen des Passwort-vergessen-Fensters */
.auth-overlay#resetOverlay.open {
    animation: none;
}

.auth-modal.reset-modal {
    animation: none;
}

.reset-modal.step-email .reset-step-email,
.reset-modal.step-code .reset-step-code {
    display: flex;
}

.account-modal .auth-title {
    margin-top: 4px;
}

.account-avatar-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.account-avatar {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-gradient);
    color: var(--profile-white);
    box-shadow: 0 8px 22px var(--accent-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
}

.account-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-avatar-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--profile-avatar-overlay);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.account-avatar:hover .account-avatar-overlay {
    opacity: 1;
}

.account-avatar-overlay svg {
    width: 26px;
    height: 26px;
    color: var(--profile-white);
}

.account-avatar-btn {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-solid);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.account-avatar-btn:hover {
    opacity: 0.65;
}

/* Fehlermeldung im Formular */
.auth-error {
    display: none;
    margin: 4px 0 12px;
    padding: 0;
    color: var(--profile-error);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
}

.auth-error.show {
    display: block;
    animation: authFade 0.15s ease;
}

/* Konto-löschen-Fenster */
.delete-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 20px;
    border-radius: 20px;
    background: var(--profile-danger-bg);
    color: var(--profile-danger);
}

.delete-icon svg {
    width: 34px;
    height: 34px;
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 14px;
    line-height: 1.45;
    color: var(--profile-text-label);
    cursor: pointer;
}

.auth-checkbox input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--profile-danger);
    cursor: pointer;
}

.auth-submit-danger {
    background: var(--profile-danger);
    box-shadow: 0 8px 20px var(--profile-danger-shadow);
}

.auth-submit-danger:hover {
    filter: none;
    background: var(--profile-danger-hover);
    box-shadow: 0 10px 24px var(--profile-danger-shadow);
}

.auth-submit-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
    box-shadow: none;
}

/* 2-Faktor-Authentifizierung */
.twofa-step {
    display: none;
    width: 100%;
}

.twofa-step.active {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}

.twofa-status-badge {
    align-self: center;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.twofa-status-badge.active {
    background: var(--profile-success-bg);
    color: var(--profile-success);
}

.twofa-status-badge.inactive {
    background: var(--profile-surface);
    color: var(--profile-text-muted);
}

.twofa-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--profile-text-muted);
    text-align: center;
}

.twofa-qr {
    align-self: center;
    width: 200px;
    height: 200px;
    padding: 12px;
    box-sizing: border-box;
    background: var(--profile-white);
    border: 1.5px solid var(--profile-border);
    border-radius: 16px;
}

.twofa-qr img {
    width: 100%;
    height: 100%;
    display: block;
}

.twofa-secret {
    align-self: center;
    padding: 10px 16px;
    background: var(--profile-surface);
    border-radius: 10px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 15px;
    letter-spacing: 1.5px;
    color: var(--profile-text);
    word-break: break-all;
    text-align: center;
}

/* Erfolgs-Fenster (Konto erstellt) */
.success-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--profile-overlay-bg);
    backdrop-filter: blur(2px);
    z-index: 200;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.success-overlay.open {
    display: flex;
    animation: authFade 0.2s ease;
}

.success-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 20px;
    padding: 48px 44px 40px;
    box-sizing: border-box;
    background: var(--profile-white);
    border-radius: 28px;
    box-shadow: 0 30px 80px var(--profile-modal-shadow);
    animation: authPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.success-check {
    position: relative;
    width: 96px;
    height: 96px;
    margin-bottom: 28px;
}

.success-check::before {
    content: none;
}

.success-check svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.success-check-bg {
    fill: var(--accent-solid);
    transform-origin: center;
}

.success-check-circle {
    stroke: var(--accent-solid);
    stroke-width: 2.5;
}

.success-check-mark {
    stroke: #ffffff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* E-Mail-Icon (E-Mail gesendet) */
.email-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 84px;
    margin-bottom: 28px;
    border-radius: 24px;
    background: var(--accent-gradient);
    color: var(--profile-white);
    box-shadow: 0 12px 28px var(--accent-shadow);
    animation: authPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.email-icon svg {
    width: 40px;
    height: 40px;
}

.success-title {
    margin: 0 0 10px;
    font-size: 23px;
    font-weight: 700;
    color: var(--profile-text);
}

.success-subtitle {
    margin: 0 0 32px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--profile-text-muted);
}

.success-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: box-shadow 0.15s ease, transform 0.1s ease, filter 0.15s ease;
}

.success-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
}

.success-btn:active {
    transform: scale(0.99);
}

/* ------------------------------------------------------------------ */
/*  Firmenprofil-Fenster                                              */
/* ------------------------------------------------------------------ */
.company-modal {
    max-width: 440px;
    align-items: stretch;
    text-align: left;
    padding-top: 38px;
}

.company-modal .auth-title,
.company-modal .auth-subtitle {
    text-align: center;
}

.company-modal .auth-title {
    margin-bottom: 6px;
}

.company-modal .auth-subtitle {
    margin-bottom: 24px;
}

.company-logo-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

.company-logo-upload {
    display: block;
    cursor: pointer;
    padding: 4px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(21, 144, 121, 0.28), rgba(21, 144, 121, 0.06));
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.company-logo-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(21, 144, 121, 0.22);
}

.company-logo-preview {
    position: relative;
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #f3f5f4, #e7ebe9);
    background-image: var(--company-logo-image, linear-gradient(160deg, #f3f5f4, #e7ebe9));
    border: 2px solid var(--profile-white);
    color: var(--profile-text-muted);
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.company-logo-preview svg {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
}

.company-logo-preview.has-img svg {
    display: none;
}

.company-logo-camera {
    position: absolute;
    right: 4px;
    bottom: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--profile-white);
    border-radius: 50%;
    background: var(--accent-gradient);
    color: var(--profile-white);
    box-shadow: 0 6px 14px var(--accent-shadow);
    transition: transform 0.15s ease;
    z-index: 2;
}

.company-logo-upload:hover .company-logo-camera {
    transform: scale(1.08);
}

.company-logo-camera svg {
    width: 16px;
    height: 16px;
}

.company-logo-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--profile-placeholder);
}

.company-logo-remove {
    margin-top: 2px;
    background: transparent;
    color: var(--profile-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

.company-logo-remove:hover {
    color: var(--profile-danger);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.company-logo-remove.is-hidden {
    display: none;
}

body.dark .company-logo-upload {
    background: linear-gradient(135deg, rgba(21, 144, 121, 0.55), rgba(21, 144, 121, 0.18));
}

body.dark .company-logo-preview {
    background-color: #262626;
    background-image: var(--company-logo-image, linear-gradient(160deg, #2a2a2a, #202020));
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

body.dark .company-logo-camera {
    border-color: #1f1f1f;
}

/* ============ Plan-Auswahl ============ */
/* Eigene Vollbild-Seite: Sidebar/Topbar verschwinden, Hintergrund wie die normale Seite */
.plan-overlay {
    background: #f7f7f5;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    z-index: 200;
}

body.dark .plan-overlay {
    background: #1a1a1a;
}

.plan-modal {
    max-width: 1240px;
    max-height: none;
    margin: 0 auto;
    padding: 76px 40px 72px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    animation: authFade 0.2s ease;
    text-align: center;
}

.plan-overlay .auth-close {
    position: fixed;
    top: 26px;
    right: 30px;
}

.plan-logo {
    position: fixed;
    top: 10px;
    left: 16px;
    width: 208px;
    height: 60px;
    object-fit: contain;
}

.plan-logo-dark {
    display: none;
}

body.dark .plan-logo-light {
    display: none;
}

body.dark .plan-logo-dark {
    display: block;
}

.plan-modal .auth-subtitle {
    margin-bottom: 24px;
}

.plan-billing {
    display: inline-flex;
    gap: 4px;
    margin: 0 auto 30px;
    padding: 5px;
    border-radius: 999px;
    background: var(--profile-surface);
    border: 1px solid var(--profile-border);
}

.plan-billing-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--profile-text-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.plan-billing-option.active {
    background: var(--profile-white);
    color: var(--profile-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.plan-billing-badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(21, 144, 121, 0.14);
    color: var(--accent-solid);
    font-size: 11px;
    font-weight: 700;
}

.plan-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    width: 100%;
    text-align: left;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 26px 24px;
    box-sizing: border-box;
    border: 1px solid var(--profile-border);
    border-radius: 20px;
    background: var(--profile-white);
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body.dark .plan-card {
    background: #242424;
}

.plan-card:hover {
    transform: translateY(-3px);
    border-color: rgba(21, 144, 121, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.plan-card.featured {
    border-color: var(--accent-solid);
    box-shadow: 0 16px 44px rgba(21, 144, 121, 0.18);
}

.plan-card-tag {
    position: absolute;
    top: 18px;
    right: 18px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.plan-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 20px;
    border-radius: 16px;
    background: rgba(21, 144, 121, 0.12);
    color: var(--accent-solid);
}

.plan-card-icon svg {
    width: 25px;
    height: 25px;
}

.plan-card-name {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 700;
    color: var(--profile-text);
}

.plan-card-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
}

.plan-price-value {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--profile-text);
}

.plan-price-custom {
    font-size: 30px;
}

.plan-price-unit {
    font-size: 14px;
    font-weight: 500;
    color: var(--profile-text-muted);
}

.plan-card-vat {
    margin: 0 0 22px;
    font-size: 12px;
    color: var(--profile-text-muted);
}

.plan-card-desc {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--profile-text-muted);
}

.plan-card-features-title {
    margin: 0 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--profile-text-label);
}

.plan-card-features {
    flex: 1;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.plan-card-features li {
    position: relative;
    padding-left: 28px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--profile-text);
}

.plan-card-features li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 1px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: rgba(21, 144, 121, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23159079' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}

.plan-card-btn {
    height: 48px;
    border: 1px solid var(--profile-border);
    border-radius: 12px;
    background: var(--profile-white);
    color: var(--profile-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.plan-card-btn:hover {
    border-color: var(--accent-solid);
    color: var(--accent-solid);
}

.plan-card-btn:active {
    transform: scale(0.99);
}

.plan-card-btn.primary {
    border: none;
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: 0 10px 24px var(--accent-shadow);
}

.plan-card-btn.primary:hover {
    filter: brightness(1.07);
    color: #ffffff;
}

.plan-card-btn:disabled {
    cursor: default;
    opacity: 0.6;
    transform: none;
}

.plan-manage-btn {
    display: block;
    margin: 18px auto 0;
    padding: 8px 14px;
    border: none;
    background: none;
    color: var(--profile-text-muted, #8a8a87);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.plan-manage-btn:hover {
    color: var(--accent-solid);
}

.plan-manage-btn[hidden] {
    display: none;
}

/* ---- Partnercode im Plan-Fenster ---- */
.plan-referral {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: -12px auto 30px;
}

.plan-referral[hidden],
.plan-referral-box[hidden] {
    display: none;
}

.plan-referral-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid rgba(21, 144, 121, 0.28);
    border-radius: 999px;
    background: rgba(21, 144, 121, 0.08);
    color: var(--accent-solid);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.plan-referral-toggle:hover {
    border-color: rgba(21, 144, 121, 0.5);
    background: rgba(21, 144, 121, 0.14);
    transform: translateY(-1px);
}

.plan-referral-toggle svg {
    width: 16px;
    height: 16px;
}

/* Geöffnet: nur noch das Eingabefeld, der Auslöser verschwindet */
.plan-referral.is-open .plan-referral-toggle {
    display: none;
}

.plan-referral-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(440px, 100%);
    animation: planReferralIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes planReferralIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

html.reduce-motion .plan-referral-box {
    animation: none;
}

.plan-referral-field {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 6px 6px 8px;
    box-sizing: border-box;
    border: 1px solid var(--profile-border);
    border-radius: 16px;
    background: var(--profile-white);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

body.dark .plan-referral-field {
    background: #242424;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.plan-referral-field:focus-within {
    border-color: var(--accent-solid);
    box-shadow: 0 0 0 4px var(--profile-focus-ring);
}

.plan-referral-box.is-valid .plan-referral-field {
    border-color: var(--accent-solid);
}

.plan-referral-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: rgba(21, 144, 121, 0.12);
    color: var(--accent-solid);
}

.plan-referral-ic svg {
    width: 18px;
    height: 18px;
}

.plan-referral-input {
    flex: 1;
    min-width: 0;
    padding: 0 4px;
    border: none;
    background: transparent;
    color: var(--profile-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    outline: none;
}

.plan-referral-input::placeholder {
    color: var(--profile-placeholder);
    font-weight: 600;
}

.plan-referral-apply {
    flex-shrink: 0;
    padding: 10px 18px;
    border: none;
    border-radius: 11px;
    background: var(--accent-gradient);
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.plan-referral-apply:hover:not(:disabled) {
    transform: translateY(-1px);
}

.plan-referral-apply:disabled {
    opacity: 0.6;
    cursor: default;
}

.plan-referral-status {
    margin: 0;
    color: var(--profile-text-muted);
    font-size: 13px;
    font-weight: 500;
}

.plan-referral-status:empty {
    display: none;
}

.plan-referral-status.is-ok {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(21, 144, 121, 0.12);
    color: var(--accent-solid);
    font-weight: 600;
}

.plan-referral-status.is-ok::before {
    content: "✓";
    font-weight: 800;
}

.plan-referral-status.is-error {
    color: var(--profile-error);
}

/* Scrollbar der Plan-Seite im Stil der App: schmal, dezent, grüner Akzent */
.plan-overlay,
.contact-overlay {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}

body.dark .plan-overlay,
body.dark .contact-overlay {
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.plan-overlay::-webkit-scrollbar,
.contact-overlay::-webkit-scrollbar {
    width: 10px;
}

.plan-overlay::-webkit-scrollbar-track,
.contact-overlay::-webkit-scrollbar-track {
    background: transparent;
}

.plan-overlay::-webkit-scrollbar-thumb,
.contact-overlay::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.16);
    background-clip: padding-box;
}

body.dark .plan-overlay::-webkit-scrollbar-thumb,
body.dark .contact-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    background-clip: padding-box;
}

.plan-overlay::-webkit-scrollbar-thumb:hover,
.contact-overlay::-webkit-scrollbar-thumb:hover,
body.dark .plan-overlay::-webkit-scrollbar-thumb:hover,
body.dark .contact-overlay::-webkit-scrollbar-thumb:hover {
    background: var(--accent-solid);
    background-clip: padding-box;
}

/* ---- Enterprise-Kontaktformular ---- */
.contact-overlay {
    z-index: 220;
    overflow-y: auto;
    padding: 20px 0;
    box-sizing: border-box;
}

.contact-overlay.open {
    align-items: flex-start;
}

.contact-modal {
    max-width: 600px;
    margin: auto 20px;
}

.contact-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.contact-view[hidden] {
    display: none;
}

.contact-modal .auth-subtitle {
    max-width: 440px;
    margin-bottom: 28px;
    line-height: 1.5;
}

.contact-modal .auth-form {
    gap: 16px;
}

.contact-optional {
    font-style: normal;
    font-weight: 500;
    color: var(--profile-text-muted);
}

.contact-sizes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.contact-size {
    position: relative;
    cursor: pointer;
}

.contact-size input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-field .contact-size span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 1.5px solid var(--profile-border);
    border-radius: 12px;
    background: var(--profile-input-bg);
    color: var(--profile-text);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.contact-size:hover span {
    border-color: var(--accent-solid);
}

.auth-field .contact-size input:checked + span {
    border-color: var(--accent-solid);
    background: rgba(21, 144, 121, 0.12);
    color: var(--accent-solid);
}

.contact-size input:focus-visible + span {
    box-shadow: 0 0 0 4px var(--profile-focus-ring);
}

.auth-field textarea {
    min-height: 120px;
    padding: 14px 18px;
    box-sizing: border-box;
    border: 1.5px solid var(--profile-border);
    border-radius: 14px;
    background: var(--profile-input-bg);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: var(--profile-text);
    outline: none;
    resize: vertical;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.auth-field textarea::placeholder {
    color: var(--profile-placeholder);
}

.auth-field textarea:focus {
    border-color: var(--accent-solid);
    background: var(--profile-white);
    box-shadow: 0 0 0 4px var(--profile-focus-ring);
}

.contact-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.contact-modal .auth-submit:disabled {
    opacity: 0.7;
    cursor: default;
}

.contact-done {
    padding: 12px 0 4px;
}

.contact-done-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: rgba(21, 144, 121, 0.14);
    color: var(--accent-solid);
}

.contact-done-icon svg {
    width: 34px;
    height: 34px;
}

.contact-done .auth-submit {
    width: 100%;
    max-width: 260px;
}

@media (max-width: 560px) {
    .contact-modal {
        padding: 44px 22px 28px;
    }

    .contact-modal .auth-field-row {
        flex-direction: column;
        gap: 16px;
    }

    .contact-sizes {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 940px) {
    .plan-modal {
        max-width: 480px;
        padding: 40px 28px 32px;
    }

    .plan-cards {
        grid-template-columns: 1fr;
    }
}

/* ---- Anmeldeart: Firmenkonto / Team-Zugang ---- */
.auth-kind {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    width: 100%;
    margin: -8px 0 26px;
    padding: 4px;
    box-sizing: border-box;
    border-radius: 14px;
    background: var(--profile-surface);
}

.auth-kind-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--profile-text-muted);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.auth-kind-btn svg {
    width: 16px;
    height: 16px;
}

.auth-kind-btn:hover {
    color: var(--profile-text);
}

.auth-kind-btn.active {
    background: var(--profile-white);
    color: var(--profile-text);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(16, 24, 40, 0.06);
}

body.dark .auth-kind-btn.active {
    background: #333;
    box-shadow: none;
}

.auth-overlay.register .auth-kind,
.auth-team-form,
.auth-overlay.team #authForm,
.auth-overlay.team .auth-trial {
    display: none;
}

.auth-overlay.team .auth-team-form {
    display: flex;
    animation: authFade 0.18s ease;
}

.auth-role-picker {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.auth-role-opt {
    position: relative;
    cursor: pointer;
}

.auth-role-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 46px;
    border: 1.5px solid var(--profile-border);
    border-radius: 12px;
    background: var(--profile-input-bg);
    color: var(--profile-text-label);
    font-size: 14px;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.auth-role-chip::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--role-color);
}

.auth-role-chip.is-admin { --role-color: #8b5cf6; }
.auth-role-chip.is-ersteller { --role-color: #3b82f6; }
.auth-role-chip.is-mitarbeiter { --role-color: var(--accent-solid); }

.auth-role-opt:hover .auth-role-chip {
    border-color: var(--profile-hover-border);
}

.auth-role-opt input:checked + .auth-role-chip {
    border-color: var(--role-color);
    background: color-mix(in srgb, var(--role-color) 10%, var(--profile-white));
    color: var(--profile-text);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--role-color) 14%, transparent);
}

.auth-role-opt input:focus-visible + .auth-role-chip {
    outline: 2px solid var(--role-color);
    outline-offset: 2px;
}

.auth-team-form input[name="code"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-team-note {
    margin: -4px 0 0;
    font-size: 12.5px;
    color: var(--profile-text-muted);
    text-align: center;
}

/* Team-Sitzungen: Konto-Funktionen des Inhabers ausblenden */
body.is-team-member #accountInfoBtn,
body.is-team-member #planBtn,
body.is-team-member #changePasswordBtn,
body.is-team-member #twoFactorBtn,
body.is-team-member #deleteAccountBtn,
body[data-team-role="mitarbeiter"] #createInstructionBtn {
    display: none !important;
}

