/* Anmeldeseiten von Kundenportal und Agentur-Backend (auth/layout.blade.php).
   Geladen zusaetzlich zu admin.css; Tokens und Knoepfe kommen von dort. */

/* Leuchten hinter der Ueberschrift in der Farbe des gerade gezeigten
   Portals. @property, damit der Farbwechsel weich uebergeht. */
@property --glow {
    syntax: '<color>';
    inherits: true;
    initial-value: #b7dc24;
}

body.auth { background: var(--bg); }
.auth-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; min-height: 100dvh; }

.auth-brand {
    position: relative; overflow: hidden; isolation: isolate;
    display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem;
    padding: 3rem clamp(2rem, 5vw, 4.5rem);
    background: var(--ink); color: #fff;
    --glow: var(--berufsmagnet);
    transition: --glow 1.2s ease;
}
.auth-brand[data-portal="anfragemagnet"] { --glow: var(--anfragemagnet); }
.auth-brand[data-portal="grundmagnet"] { --glow: var(--grundmagnet); }
.auth-brand::before {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(60% 45% at 15% 105%, color-mix(in srgb, var(--glow) 38%, transparent), transparent 70%),
        radial-gradient(40% 30% at 95% 0%, color-mix(in srgb, var(--glow) 16%, transparent), transparent 70%);
}
/* Feines Punktraster, damit die Flaeche nicht leer wirkt. */
.auth-brand::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.auth-logo { height: 34px; width: auto; align-self: flex-start; }

.auth-headline {
    margin: 0 0 1.25rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05;
    font-size: clamp(2.3rem, 4.2vw, 3.6rem);
}
.auth-lead { margin: 0; max-width: 34rem; color: rgba(255, 255, 255, .72); font-size: 1.05rem; line-height: 1.6; }

/* Das wechselnde Wort, Buchstabe fuer Buchstabe (portal.js). */
.wechselwort { display: inline-block; white-space: nowrap; color: var(--glow); perspective: 600px; }
.wechselwort .zeichen { display: inline-block; transform-origin: 50% 100%; will-change: transform, opacity, filter; }
.wechselwort .zeichen.rein { animation: zeichen-rein .6s cubic-bezier(.2, .9, .25, 1) both; animation-delay: calc(var(--i) * 38ms); }
.wechselwort .zeichen.raus { animation: zeichen-raus .32s cubic-bezier(.5, 0, .9, .5) both; animation-delay: calc(var(--i) * 22ms); }
@keyframes zeichen-rein {
    from { opacity: 0; transform: translateY(.55em) rotateX(-75deg); filter: blur(8px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes zeichen-raus {
    to { opacity: 0; transform: translateY(-.45em) rotateX(70deg); filter: blur(8px); }
}

/* Die drei Portallogos. Das zum Wort passende steht in Farbe, die anderen
   grau zurueck. */
.auth-portale { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: .75rem clamp(1.5rem, 3.5vw, 2.75rem); flex-wrap: wrap; }
.auth-portale li { transition: transform .6s cubic-bezier(.2, .9, .25, 1); }
.auth-portale img {
    display: block; height: 36px; width: auto; opacity: .45; filter: grayscale(1) brightness(1.4);
    transition: opacity .5s ease, filter .5s ease;
}
.auth-portale li.aktiv { transform: translateY(-4px) scale(1.06); }
.auth-portale li.aktiv img {
    opacity: 1;
    filter: grayscale(0) brightness(1) drop-shadow(0 8px 20px color-mix(in srgb, var(--glow) 50%, transparent));
}

/* Rechte Seite: Formular mittig, Rechtstexte unten. */
.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 3rem clamp(1.5rem, 6vw, 5rem) 1.5rem; }
.auth-form { width: 100%; max-width: 25rem; margin: auto; }
.auth-form h1 { font-size: 2rem; margin: 0 0 .5rem; }
.auth-text { color: var(--muted); margin-bottom: 1.75rem; }
.auth-text strong { color: var(--ink); }
.auth-form input[type=email] { height: 3rem; }
.auth-submit { width: 100%; height: 3rem; font-size: 1rem; }
.auth-merken { display: flex; align-items: center; gap: .5rem; margin: 1.1rem 0 0; font-size: .9rem; color: var(--muted); }
.auth-merken svg { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.auth-hilfe { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.auth-icon {
    display: inline-flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem;
    margin-bottom: 1.25rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(2, 2, 2, .06);
}
.auth-icon svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-actions { display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; margin-top: 1.5rem; }
.auth-link { color: var(--muted); font-weight: 500; }
.auth-footer {
    display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap;
    margin-top: 3rem; font-size: .82rem; color: var(--muted);
}
.auth-footer nav { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.auth-footer a { color: var(--muted); text-decoration: none; }
.auth-footer a:hover { color: var(--ink); text-decoration: underline; }

/* Handy: Markenflaeche oben kompakt, Formular darunter. */
@media (max-width: 860px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand { padding: 1.5rem 1.25rem 1.75rem; gap: 1.5rem; }
    .auth-logo { height: 28px; }
    .auth-headline { font-size: 2rem; margin-bottom: .75rem; }
    .auth-lead { font-size: .95rem; }
    .auth-portale { gap: .6rem 1.25rem; }
    .auth-portale img { height: 26px; }
    .auth-main { padding: 2rem 1.25rem 1.25rem; }
    .auth-form { margin: 0 auto; }
    .auth-form h1 { font-size: 1.6rem; }
    .auth-footer { margin-top: 2.5rem; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-brand, .auth-portale li, .auth-portale img { transition: none; }
    .wechselwort .zeichen.rein, .wechselwort .zeichen.raus { animation: none; }
}

/* Backend: kleine Zeile ueber der Ueberschrift. */
.auth-kicker {
    display: inline-block; margin: 0 0 1rem; padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .8);
    font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600;
}
.auth-form input[type=password], .auth-form input[type=text] { height: 3rem; }
.auth-code { font-family: var(--mono); font-size: 1.25rem; letter-spacing: .3em; }
.auth-recovery { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.auth-recovery summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.auth-recovery summary:hover { color: var(--ink); }
.auth-recovery form { margin-top: .9rem; }

/* Helle Fassung fuer den Agentur-Login: dunkler Inhalt auf Weiss, damit
   er sich vom Kundenportal absetzt. */
.auth-brand.hell { background: var(--surface); color: var(--ink); border-right: 1px solid var(--line); }
.auth-brand.hell::before {
    background:
        radial-gradient(60% 45% at 15% 105%, color-mix(in srgb, var(--glow) 26%, transparent), transparent 70%),
        radial-gradient(40% 30% at 95% 0%, color-mix(in srgb, var(--glow) 12%, transparent), transparent 70%);
}
.auth-brand.hell::after { background-image: radial-gradient(rgba(2, 2, 2, .08) 1px, transparent 1px); }
/* Die Portalfarben sind auf Weiss zu hell zum Lesen - abgedunkelt. */
.auth-brand.hell .wechselwort { color: color-mix(in srgb, var(--glow) 72%, var(--ink)); }
.auth-brand.hell .auth-lead { color: var(--muted); }
.auth-brand.hell .auth-kicker { border-color: var(--line-strong); color: var(--muted); }
.auth-brand.hell .auth-portale img { opacity: .4; filter: grayscale(1); }
.auth-brand.hell .auth-portale li.aktiv img {
    opacity: 1;
    filter: grayscale(0) drop-shadow(0 8px 18px color-mix(in srgb, var(--glow) 40%, transparent));
}
@media (max-width: 860px) {
    .auth-brand.hell { border-right: 0; border-bottom: 1px solid var(--line); }
}
