/* ================================================================
   LOGIN — gemeinsames Geruest fuer ERP, Cockpit und Kundenportal
   ================================================================
   Herausgezogen am 28.07.2026 aus resources/views/auth/login.twig.

   Hier steht NUR der Aufbau: Flaechenaufteilung, Karte, Felder, Knopf,
   Hinweise, Umbruchverhalten. Bewusst KEINE Farbwerte-Definitionen.

   Die Farbpalette setzt jede Seite selbst als CSS-Variablen, bevor oder
   nachdem sie diese Datei einbindet:

     --login-bg --login-text --login-text-muted --login-card-bg
     --login-border --login-input-bg
     --login-primary --login-primary-2 --login-primary-glow --login-primary-soft
     --login-hero-bg-from --login-hero-bg-to --login-hero-glow --login-hero-glow2

   Grund fuer die Trennung: Auf der ERP-Seite kommt --login-primary aus den
   Firmeneinstellungen des Mandanten (White-Label) und muss deshalb durch Twig
   laufen. Der Aufbau drumherum ist bei allen drei Seiten identisch und gehoert
   genau einmal gepflegt.
   ================================================================ */

/* ================================================================
   LOGIN-PAGE — Premium White-Label Design (Dark + Light)
   ================================================================ */

/* Reset auth-page um vom generischen CSS unabhängig zu sein */
body {
    margin: 0;
    /* Hausschrift auch fuer Cockpit und Kundenportal (28.07.2026).
       Die beiden sind eigenstaendige Seiten und laden app.css NICHT — ohne
       diese Zeile fielen sie auf die Serifenschrift des Browsers zurueck.
       Aufgefallen ist es erst auf Jesses eigenen Bildschirmfotos.
       Gleiche Kette wie --font-sans in app.css, hier ausgeschrieben, damit sie
       auch ohne app.css greift. */
    /* Seit 28.07.2026 die echte Hausschrift aus schrift.css statt der
       Systemschrift-Kette — dieselbe wie im Cockpit und im Kundenportal,
       damit Vorzimmer und Innenraum nicht in zwei Schriften sprechen.
       Der Rückfall bleibt stehen, falls schrift.css einmal nicht lädt. */
    font-family: var(--schrift-text, -apple-system), BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    background: var(--login-bg, #f1f5f9);
    color: var(--login-text, #1e293b);
}

/* Hero (links) — sichtbar ab Tablet */
.login-hero {
    display: none;
    position: relative;
    background:
        radial-gradient(circle at 20% 30%, var(--login-hero-glow, rgba(59,130,246,0.45)) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, var(--login-hero-glow2, rgba(139,92,246,0.35)) 0%, transparent 55%),
        linear-gradient(135deg, var(--login-hero-bg-from, #1e3a8a), var(--login-hero-bg-to, #581c87));
    color: #fff;
    overflow: hidden;
    padding: 4rem 3rem;
}
.login-hero::before {
    content: '';
    position: absolute; inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath fill='%23ffffff08' d='M0 0h40v40H0z'/%3E%3Cpath fill='%23ffffff05' d='M0 0h20v20H0zM20 20h20v20H20z'/%3E%3C/svg%3E");
    opacity: 0.4;
}
/* Schaltkreis-Canvas (Landing-Signatur, dezent in Weiß — white-label-neutral) */
.login-hero canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}
.login-hero-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}
.login-hero-top { display: flex; align-items: center; gap: 1rem; }
.login-hero-top .logo-square {
    width: 48px; height: 48px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: 1.5rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.login-hero-top .platform-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.7;
    font-weight: 600;
}
.login-hero h2 {
    font-family: var(--schrift-anzeige, inherit);
    font-size: 3.1rem;
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: 0;
    margin: 0 0 1.25rem 0;
}
.login-hero h2 strong {
    /* Der zweite Ton war bis 28.07.2026 fest auf Indigo verdrahtet und wirkte
       auf der warmen Flaeche des Kundenportals wie ein Fremdkoerper. Jetzt
       variabel — der Standardwert ist der bisherige, das ERP bleibt gleich. */
    background: linear-gradient(120deg, #fff, var(--login-hero-accent, #c7d2fe));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}
.login-hero .lead {
    font-size: 1.05rem;
    opacity: 0.85;
    line-height: 1.6;
    max-width: 440px;
}
.login-hero-features {
    margin-top: 2.5rem;
    display: grid;
    gap: 0.85rem;
}
.login-hero-features .feat {
    display: flex; align-items: flex-start; gap: 0.75rem;
    font-size: 0.95rem;
    opacity: 0.92;
}
.login-hero-features .feat .icon {
    flex-shrink: 0;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.login-hero-footer {
    font-size: 0.85rem; opacity: 0.6;
    border-top: 1px solid rgba(255,255,255,0.15);
    padding-top: 1.25rem;
}

/* Form-Section (rechts oder mobile-full) */
.login-form-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    position: relative;
}
.login-form-section .theme-switch {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    display: flex; gap: 0.4rem;
}
.login-form-section .theme-switch button {
    background: var(--login-card-bg, #fff);
    border: 1px solid var(--login-border, rgba(15,23,42,0.1));
    width: 36px; height: 36px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--login-text-muted, #64748b);
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.login-form-section .theme-switch button:hover {
    border-color: var(--login-primary, var(--accent));
    color: var(--login-primary, var(--accent));
}
.login-form-section .theme-switch button.active {
    border-color: var(--login-primary, var(--accent));
    color: var(--login-primary, var(--accent));
    background: var(--login-primary-soft, rgba(59,130,246,0.08));
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .login-card { animation: none !important; }
}
.login-card {
    animation: loginCardIn .55s cubic-bezier(.22,.9,.32,1) both;
    width: 100%;
    max-width: 440px;
    background: var(--login-card-bg, #fff);
    border: 1px solid var(--login-border, rgba(15,23,42,0.08));
    border-radius: 20px;
    padding: 2.5rem 2.25rem;
    box-shadow:
        0 32px 64px -16px rgba(15,23,42,0.18),
        0 4px 12px rgba(15,23,42,0.06);
}
.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}
.login-brand .brand-logo {
    width: 72px; height: 72px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--login-primary, var(--accent)), var(--login-primary-2, #6366f1));
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 800; color: #fff;
    box-shadow: 0 12px 32px var(--login-primary-glow, rgba(59,130,246,0.35));
}
.login-brand img.brand-logo {
    object-fit: contain;
    background: var(--login-card-bg, #fff);
    border: 1px solid var(--login-border, rgba(15,23,42,0.08));
    padding: 6px;
}
.login-brand h1 {
    font-family: var(--schrift-anzeige, inherit);
    font-size: 2.05rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--login-text, #1e293b);
    letter-spacing: 0;
    line-height: 1.1;
}
.login-brand .greet {
    color: var(--login-text-muted, #64748b);
    font-size: 0.95rem;
    margin: 0;
}

.login-form .field { margin-bottom: 1.25rem; }
.login-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--login-text, #1e293b);
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}
.login-form input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--login-border, rgba(15,23,42,0.15));
    border-radius: 12px;
    background: var(--login-input-bg, #f8fafc);
    color: var(--login-text, #1e293b);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.15s;
    box-sizing: border-box;
}
.login-form input::placeholder { color: var(--login-text-muted, #94a3b8); opacity: 0.8; }
.login-form input:focus {
    outline: none;
    border-color: var(--login-primary, var(--accent));
    background: var(--login-card-bg, #fff);
    box-shadow: 0 0 0 4px var(--login-primary-glow, rgba(59,130,246,0.15));
}

.login-submit {
    width: 100%;
    padding: 0.95rem 1rem;
    background: linear-gradient(135deg, var(--login-primary, var(--accent)), var(--login-primary-2, #6366f1));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 0 8px 24px var(--login-primary-glow, rgba(59,130,246,0.35));
    margin-top: 0.75rem;
    letter-spacing: 0.01em;
}
.login-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px var(--login-primary-glow, rgba(59,130,246,0.45));
}
.login-submit:active { transform: translateY(0); }

.login-alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(239,68,68,0.1);
    color: #dc2626;
    border: 1px solid rgba(239,68,68,0.25);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.login-footer {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--login-border, rgba(15,23,42,0.08));
    text-align: center;
    font-size: 0.8rem;
    color: var(--login-text-muted, #64748b);
}
.login-footer .env-pill {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-right: 0.25rem;
    background: var(--login-primary-soft, rgba(59,130,246,0.12));
    color: var(--login-primary, var(--accent));
}
.login-footer .env-pill.production { background: rgba(34,197,94,0.12); color: #16a34a; }
.login-footer .env-pill.test { background: rgba(245,158,11,0.12); color: #d97706; }
.login-footer .env-pill.local { background: rgba(139,92,246,0.12); color: #7c3aed; }

/* RESPONSIVE — Split-Screen ab 900px */
@media (min-width: 900px) {
    .login-shell { grid-template-columns: 1.1fr 1fr; }
    .login-hero { display: flex; align-items: stretch; }
}

@media (max-width: 480px) {
    .login-card { padding: 2rem 1.5rem; }
    .login-brand .brand-logo { width: 60px; height: 60px; }
    .login-brand h1 { font-size: 1.5rem; }
}

/* ================================================================
   DUNKLE DARSTELLUNG — Flaeche und Karte
   ================================================================
   Diese beiden Regeln standen bis 28.07.2026 im Farbblock der ERP-Anmeldung,
   sind aber Aufbau und keine Farbdefinition — Cockpit und Kundenportal
   brauchen sie genauso. Die Farbwerte darin waren fest auf Blau/Violett
   verdrahtet; jetzt kommen sie aus Variablen, deren Standardwerte exakt den
   bisherigen entsprechen. Die ERP-Anmeldung sieht dadurch unveraendert aus,
   die anderen beiden koennen einen eigenen Schimmer setzen.
   ================================================================ */
html[data-theme="dark"] .login-shell {
    background:
        radial-gradient(circle at top right, var(--login-shell-glow, rgba(59,130,246,0.12)), transparent 60%),
        radial-gradient(circle at bottom left, var(--login-shell-glow2, rgba(139,92,246,0.10)), transparent 50%),
        var(--login-bg);
}
html[data-theme="dark"] .login-card {
    backdrop-filter: blur(20px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                0 0 60px var(--login-card-glow, rgba(59, 130, 246, 0.08));
}

/* ================================================================
   BEREICHSWECHSEL — Verlinkung in die anderen Bereiche
   ================================================================
   Angelegt am 28.07.2026 auf Jesses Wunsch: von der Anmeldung aus soll man
   die anderen Portale erreichen.

   Bewusst KEINE Unterscheidung allein ueber Farbe: jeder Eintrag hat Zeichen
   UND Text UND eine eigene Umrandung. Farbe ist hier nur Zugabe, nie das
   einzige Merkmal.
   ================================================================ */
.login-switch {
    margin-top: 1.6rem;
    padding-top: 1.3rem;
    border-top: 1px solid var(--login-border);
}
.login-switch-title {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--login-text-muted);
    text-align: center;
    margin-bottom: .8rem;
}
.login-switch-links {
    display: grid;
    gap: .55rem;
}
.login-switch-links a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .8rem;
    border: 1px solid var(--login-border);
    border-radius: 11px;
    background: var(--login-input-bg);
    color: var(--login-text);
    text-decoration: none;
    font-size: .84rem;
    font-weight: 600;
    transition: border-color .15s, transform .12s, background .15s;
}
.login-switch-links a:hover {
    border-color: var(--login-primary);
    background: var(--login-primary-soft);
    transform: translateY(-1px);
}
.login-switch-links a:focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
}
.login-switch-links .sw-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: .95rem;
    background: var(--login-primary-soft);
    border: 1px solid var(--login-border);
}
.login-switch-links .sw-text { display: flex; flex-direction: column; line-height: 1.25; }
.login-switch-links .sw-sub {
    font-size: .71rem;
    font-weight: 500;
    color: var(--login-text-muted);
}
.login-switch-links .sw-arrow {
    margin-left: auto;
    color: var(--login-text-muted);
    font-size: .9rem;
}

/* ================================================================
   NEUIGKEITEN — "Was ist neu" auf der Verlaufsflaeche
   ================================================================
   Zweiter Entwurf nach Jesses Rueckmeldung, der erste war zu gedraengt.

   Geaendert: mehr Luft, ausgeschriebenes Datum statt "28.07.", eine
   Markierung fuer wirklich frische Eintraege und ein schmaler Balken links
   statt Trennlinien zwischen den Zeilen.

   Die Markierung "Neu" traegt Text UND Position — sie ist nie nur ein
   Farbfleck. Wer Farbtoene schlecht auseinanderhaelt, liest schlicht das Wort.

   Steht VOR der Anmeldung und ist damit oeffentlich sichtbar: hier
   ausschliesslich Produkt-Neuigkeiten, niemals Mandanten- oder
   Patientendaten. Gepflegt in resources/data/login-neuigkeiten.php.
   ================================================================ */
.login-news {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.login-news-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1rem;
}
.login-news-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,.18), transparent);
}
.login-news-item {
    position: relative;
    padding: .1rem 0 .1rem 1rem;
    margin-bottom: .95rem;
}
.login-news-item:last-child { margin-bottom: 0; }

/* Schmaler Balken links statt Trennlinien zwischen den Zeilen — ruhiger. */
.login-news-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: .35rem;
    bottom: .35rem;
    width: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
}
.login-news-item.ist-neu::before { background: rgba(255, 255, 255, 0.75); }

.login-news-kopf {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .18rem;
}
.login-news-date {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
}
.login-news-badge {
    font-size: .58rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .12rem .38rem;
    border-radius: 5px;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.login-news-text {
    font-size: .82rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}
.login-news-text strong { font-weight: 700; color: #fff; }

/* Auf niedrigen Fenstern sind Haken-Liste UND Neuigkeiten zusammen zu viel —
   dann treten die Neuigkeiten zurueck. */
@media (max-height: 820px) {
    .login-news { display: none; }
}
