/* ═══════════════════════════════════════════════════════════════════════
   V103y — Dark Auth Theme
   ═══════════════════════════════════════════════════════════════════════
   Gemeinsame Styles für Landing/Index, Talent-Login und Manager-Login.
   Original-Logo wird per CSS-Filter (invert) auf Dark-BG sichtbar gemacht,
   damit keine zweite Asset-Datei nötig ist. Alle Original-Form-IDs bleiben
   unangetastet — nur Layout + Optik werden überschrieben.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
    /* V103z — Exakt die Sidebar-Farbe aus dem aktiven Portal (rgb(21,27,42)
       ermittelt via getComputedStyle auf .admin-main-nav). Damit ziehen sich
       die Markenfarben durchgängig vom Login bis ins Dashboard. */
    --auth-bg: #151b2a;
    --auth-bg-card: rgba(255, 255, 255, 0.03);
    --auth-bg-card-hover: rgba(255, 255, 255, 0.05);
    --auth-border: rgba(255, 255, 255, 0.08);
    --auth-border-strong: rgba(255, 255, 255, 0.16);
    --auth-text: #f1f5f9;
    --auth-text-muted: #94a3b8;
    --auth-text-dim: #64748b;
    --auth-accent: #818cf8;
    --auth-input-bg: rgba(255, 255, 255, 0.04);
    --auth-input-border: rgba(255, 255, 255, 0.12);
    --auth-input-border-focus: rgba(129, 140, 248, 0.6);
}

/* V103y — !important nötig: portal-v93-professional.css:29 setzt
   body { background: var(--tt-page-bg) !important } und überfährt sonst
   das Dark-Theme. */
body.tt-auth-dark {
    margin: 0 !important;
    min-height: 100vh !important;
    background: var(--auth-bg) !important;
    color: var(--auth-text) !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* V103ac — Kill-Switch für Dashboard-Chrome wenn Auth-View aktiv.
   Workflow-Audit hat 4 verschiedene CSS-Dateien gefunden die
   .talent-header, .dashboard-tabs, .admin-main-nav etc. als sticky/fixed
   weiß+1px-border setzen — alle nur via parent .hidden gegated. Bei FOUC
   (CSS lädt vor talent.js init) könnte das kurz als weiße Balken + dunkle
   Hairlines aufblitzen ("Geist-Header"). body.tt-auth-dark ist die
   authoritative Kill-Switch: alle Dashboard-Container und ihre Sticky-
   Komponenten werden hier zentral abgeschaltet, egal welche Cascade-
   Reihenfolge oder Spezifizität anderswo definiert ist. */
/* Specificity boost: existing rules wie
   "html body #dashboard-view.talent-shell .talent-header" sind (0,2,4)
   stark. Mit "html body.tt-auth-dark X Y" auf (0,2,3) + !important plus
   ID-boost wo möglich liegen wir gleichauf oder darüber. */
html body.tt-auth-dark #dashboard-view,
html body.tt-auth-dark #loading-view,
html body.tt-auth-dark .talent-shell .talent-header,
html body.tt-auth-dark #dashboard-view.talent-shell .talent-header,
html body.tt-auth-dark .talent-shell .talent-main,
html body.tt-auth-dark #dashboard-view.talent-shell .dashboard-tabs,
html body.tt-auth-dark .talent-shell .dashboard-tabs,
html body.tt-auth-dark .admin-main-nav,
html body.tt-auth-dark .container > header {
    display: none !important;
    visibility: hidden !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

/* Legacy Talent/Admin Auth-Panel verliert auf Dark-Theme alle weißen Surface-
   Styles. */
/* V103an — width: auto entfernt: das hat die Form-Card auf content-Breite
   shrinken lassen — bei längeren deutschen Wörtern wurde sie breiter
   als beim englischen, also schwankten alle Felder mit. Stattdessen jetzt
   feste Breite über .tt-auth-form-card-Regel weiter unten. */
body.tt-auth-dark .talent-auth-panel,
body.tt-auth-dark .auth-container .card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    width: min(420px, 100%) !important;
    padding: 0 !important;
}
body.tt-auth-dark #auth-view.tt-auth-shell {
    background: transparent !important;
    border: 0 !important;
}

.tt-auth-dark *,
.tt-auth-dark *::before,
.tt-auth-dark *::after {
    box-sizing: border-box;
}

/* Subtle radial-gradient backdrop für etwas Tiefe */
body.tt-auth-dark::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(129, 140, 248, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(99, 102, 241, 0.05) 0%, transparent 50%);
    z-index: 0;
}

.tt-auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 28px 36px;
}

/* V103y — !important nötig: ui.css setzt header { background, padding,
   border-radius, box-shadow } global.
   V103ab — Zusätzlich border:0 erzwingen, weil ui.css's `*` Reset eine
   1px rgba(0,0,0,0.1) Border setzt, die auf der dunklen Auth-Page als
   feiner heller Header-Geist sichtbar wird (User-Bug). */
.tt-auth-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    background: transparent !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.tt-auth-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

/* V103z — Echte weiße SVG-Datei (assets/truetalent-logo-white.svg) statt
   CSS-Filter. Sauberer und schärfer auf allen DPRs. */
.tt-auth-logo {
    height: 32px !important;
    width: auto !important;
    display: block !important;
}
/* Kleinere Variante für Login-Formulare (zentriert über Title) */
.tt-auth-logo--small {
    height: 22px !important;
    margin: 0 auto 24px !important;
    opacity: 0.85;
}

/* V103z — Back-Button textbasiert ohne Pillbox-Border. Icon im sanften
   Kreis, Text rechts daneben. Hover: dezenter Background-Wash. */
.tt-auth-back-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: 36px !important;
    /* V103am — Mindestbreite verhindert dass „Back" schmaler wird als „Zurück". */
    min-width: 108px !important;
    padding: 0 12px 0 6px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--auth-text-muted) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: background 140ms ease, color 140ms ease !important;
    font-family: inherit !important;
    box-shadow: none !important;
    letter-spacing: 0.01em;
}
.tt-auth-back-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--auth-text) !important;
}
.tt-auth-back-btn .tt-auth-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    transition: background 140ms ease, transform 140ms ease;
}
.tt-auth-back-btn:hover .tt-auth-back-icon {
    background: rgba(129, 140, 248, 0.18);
    transform: translateX(-2px);
}

/* V103ad — Echtes Dropdown statt Click-toggle. Native <details>-Element
   handhabt Open/Close-State, JS schließt zusätzlich bei Outside-Click. */
.tt-auth-lang-dropdown {
    position: relative !important;
    display: inline-block !important;
}
.tt-auth-lang-dropdown > summary {
    list-style: none !important;
    cursor: pointer !important;
}
.tt-auth-lang-dropdown > summary::-webkit-details-marker { display: none !important; }
.tt-auth-lang-dropdown > summary::marker { display: none !important; content: "" !important; }

.tt-auth-lang-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    height: 36px !important;
    /* V103am — Konstante Breite, damit DEU/ENG nicht unterschiedlich wirken. */
    min-width: 78px !important;
    padding: 0 12px !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: 8px !important;
    background: transparent !important;
    color: var(--auth-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 120ms ease, border-color 120ms ease !important;
    font-family: inherit !important;
    letter-spacing: 0.02em !important;
    box-shadow: none !important;
}
.tt-auth-lang-toggle:hover {
    background: var(--auth-bg-card) !important;
    border-color: var(--auth-border-strong) !important;
}
.tt-auth-lang-chevron {
    width: 14px;
    height: 14px;
    color: var(--auth-text-muted);
    transition: transform 160ms ease;
    flex-shrink: 0;
}
.tt-auth-lang-dropdown[open] .tt-auth-lang-chevron {
    transform: rotate(180deg);
}

/* V103ad — Menü nur sichtbar wenn das <details> offen ist. Ohne
   [open]-Scope würde mein display:flex den Browser-Default (display:none
   für nicht-erste-Kinder von <details>) überschreiben und das Menü wäre
   permanent sichtbar. */
.tt-auth-lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 140px;
    padding: 4px;
    background: rgba(28, 36, 56, 0.96);
    border: 1px solid var(--auth-border-strong);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 50;
    flex-direction: column;
    gap: 2px;
}
.tt-auth-lang-dropdown[open] > .tt-auth-lang-menu {
    display: flex !important;
}
.tt-auth-lang-option {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    padding: 9px 12px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--auth-text) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    text-align: left !important;
    cursor: pointer !important;
    border-radius: 6px !important;
    transition: background 120ms ease !important;
    box-shadow: none !important;
}
.tt-auth-lang-option:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}
.tt-auth-lang-option.active {
    background: rgba(129, 140, 248, 0.12) !important;
    color: var(--auth-accent) !important;
}
.tt-auth-lang-option-check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0;
}
.tt-auth-lang-option.active .tt-auth-lang-option-check {
    opacity: 1;
}

.tt-auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

/* ── Landing / Portal-Switcher ────────────────────────────────────────── */
.tt-auth-landing {
    width: 100%;
    max-width: 820px;
    text-align: center;
}
.tt-auth-landing h1 {
    margin: 0 0 18px !important;
    font-size: 44px !important;
    font-weight: 500 !important;
    color: var(--auth-text) !important;
    letter-spacing: -0.025em !important;
    line-height: 1.15 !important;
    text-align: center !important;
}
.tt-auth-landing-subtitle {
    margin: 0 auto 56px !important;
    font-size: 16px !important;
    color: var(--auth-text-muted) !important;
    line-height: 1.6 !important;
    max-width: 520px !important;
    text-align: center !important;
}
.tt-auth-landing-cards {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin-top: 0 !important;
}
.tt-auth-portal-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 36px 28px 32px !important;
    background: var(--auth-bg-card) !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: 16px !important;
    text-decoration: none !important;
    color: var(--auth-text) !important;
    cursor: pointer !important;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease !important;
    font-family: inherit !important;
    text-align: center !important;
    box-shadow: none !important;
}
.tt-auth-portal-card:hover {
    background: var(--auth-bg-card-hover);
    border-color: var(--auth-border-strong);
}
.tt-auth-portal-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, 0.1);
    color: var(--auth-accent);
    margin-bottom: 4px;
}
.tt-auth-portal-card-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.75;
}
.tt-auth-portal-card-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--auth-text);
    margin: 0;
}
.tt-auth-portal-card-desc {
    font-size: 13px;
    color: var(--auth-text-muted);
    line-height: 1.55;
    margin: 0;
    min-height: 60px;
}
.tt-auth-portal-card-arrow {
    margin-top: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, 0.12);
    color: var(--auth-accent);
    transition: background 160ms ease, transform 160ms ease;
}
.tt-auth-portal-card:hover .tt-auth-portal-card-arrow {
    background: var(--auth-accent);
    color: var(--auth-bg);
    transform: translateX(4px);
}

/* ── Login-Form ─────────────────────────────────────────────────────── */
.tt-auth-form-card {
    /* V103am — Feste Breite verhindert Layout-Shift bei Sprachwechsel.
       Auf schmalen Viewports clamped die min()-Funktion auf 100%. */
    width: min(420px, 100%);
    text-align: center;
}
.tt-auth-form-card h1 {
    margin: 0 0 12px !important;
    font-size: 28px !important;
    font-weight: 500 !important;
    color: var(--auth-text) !important;
    letter-spacing: -0.02em !important;
    text-align: center !important;
}
.tt-auth-form-subtitle {
    margin: 0 0 32px !important;
    font-size: 14px !important;
    color: var(--auth-text-muted) !important;
    line-height: 1.55 !important;
    text-align: center !important;
}
.tt-auth-form {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tt-auth-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tt-auth-form-group label {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--auth-text-muted) !important;
    letter-spacing: 0.02em !important;
    text-align: left !important;
    margin: 0 !important;
}
.tt-auth-input-wrap {
    position: relative;
}
/* V103y — !important nötig: ui.css/talent.css setzen input { background,
   border, color } global. */
.tt-auth-input {
    width: 100% !important;
    height: 44px !important;
    padding: 0 14px !important;
    border: 1px solid var(--auth-input-border) !important;
    border-radius: 10px !important;
    background: var(--auth-input-bg) !important;
    color: var(--auth-text) !important;
    font-size: 14px !important;
    font-family: inherit !important;
    transition: border-color 120ms ease, background 120ms ease !important;
    outline: none !important;
    box-shadow: none !important;
}
.tt-auth-input::placeholder {
    color: var(--auth-text-dim);
}
.tt-auth-input:focus {
    border-color: var(--auth-input-border-focus);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}
.tt-auth-input--with-toggle {
    padding-right: 44px;
}
.tt-auth-password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--auth-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 120ms ease, background 120ms ease;
}
.tt-auth-password-toggle:hover {
    color: var(--auth-text);
    background: rgba(255, 255, 255, 0.05);
}
.tt-auth-password-toggle svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.75;
}

.tt-auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
}
.tt-auth-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}
.tt-auth-checkbox-wrap input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--auth-input-border);
    border-radius: 4px;
    background: var(--auth-input-bg);
    cursor: pointer;
    position: relative;
    transition: background 120ms ease, border-color 120ms ease;
    flex-shrink: 0;
}
.tt-auth-checkbox-wrap input:checked {
    background: var(--auth-accent);
    border-color: var(--auth-accent);
}
.tt-auth-checkbox-wrap input:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border-right: 2px solid #0a1020;
    border-bottom: 2px solid #0a1020;
    transform: rotate(45deg);
}
.tt-auth-link {
    color: var(--auth-accent);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.tt-auth-link:hover {
    text-decoration: underline;
}

/* V103y — !important nötig: button.btn-primary global gestylt mit dunkler
   Background, das soll für Dark-Auth-Theme weiß sein. */
.tt-auth-submit {
    width: 100% !important;
    height: 46px !important;
    margin-top: 12px !important;
    border: 0 !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: #0a1020 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background 120ms ease, transform 80ms ease !important;
    font-family: inherit !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
}
.tt-auth-submit:hover {
    background: #e2e8f0 !important;
}
.tt-auth-submit:hover {
    background: #e2e8f0;
}
.tt-auth-submit:active {
    transform: scale(0.99);
}
.tt-auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tt-auth-error {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 13px;
    text-align: left;
    min-height: 0;
}
.tt-auth-error:empty {
    display: none;
}

.tt-auth-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    font-size: 13px;
    color: var(--auth-text-muted);
}
.tt-auth-footer a {
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 120ms ease;
}
.tt-auth-footer a:hover {
    color: var(--auth-text);
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .tt-auth-shell {
        padding: 20px;
    }
    .tt-auth-landing h1 {
        font-size: 28px;
    }
    .tt-auth-landing-cards {
        grid-template-columns: 1fr;
    }
    .tt-auth-portal-card-desc {
        min-height: 0;
    }
}

/* ── Versteckt das alte Label/Eingabe sobald wir das neue Layout zeigen ── */
.tt-auth-dark .auth-container,
.tt-auth-dark .card.tt-auth-legacy,
.tt-auth-dark .talent-auth-panel.tt-auth-legacy {
    all: unset;
}
