/* ============================
   KitchenCloud – Theme: Auth
   ============================
   Styling für Login & Registrierung (Views/AuthGui/*).
   Baut auf den Farbvariablen aus kc-theme.css auf (--kc-primary, --kc-bg, ...),
   diese Datei wird deshalb IMMER NACH kc-theme.css eingebunden (siehe
   _Layout.cshtml -> Section "Styles").

   Aufbau:
   1) Seiten-Hintergrund (Hero-Panel + weiche Farbflächen)
   2) Zwei-Spalten-Shell (Bild-Panel + Formular-Karte)
   3) Login/Registrieren-Tabs
   4) Eingabefelder mit Floating-Label
   5) Buttons
   6) Fehlermeldung
   7) Einblend-Animationen
   8) Responsive (Mobile)
   ============================ */

/* ----------------------------
   1) Seiten-Hintergrund
   ----------------------------
   Eigenes "Hero"-Panel in warmen, hellen Tönen, das sich vom knalligen
   Lime-Hintergrund des Body abhebt. Zwei weiche, verschwommene Farbflecken
   (::before/::after) sorgen für Tiefe, ohne dass echte Bilder geladen werden. */
.kc-auth-page {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, var(--kc-bg-soft) 0%, var(--kc-bg) 55%, #ffffff 100%);
    border-radius: 28px;
    padding: 3rem 1.5rem;
    box-shadow: 0 1px 0 rgba(47, 58, 29, 0.05) inset;
}

    .kc-auth-page::before,
    .kc-auth-page::after {
        content: "";
        position: absolute;
        z-index: 0;
        border-radius: 50%;
        filter: blur(60px);
        opacity: 0.35;
        pointer-events: none;
    }

    .kc-auth-page::before {
        width: 320px;
        height: 320px;
        top: -120px;
        left: -80px;
        /* War Türkis (--kc-secondary) - passt nicht mehr zur warmen Terracotta/Senf-
           Palette, die der Rest der App inzwischen nutzt (siehe kc-dashboard.css). */
        background: var(--kc-terracotta);
        animation: kc-blob-float 9s ease-in-out infinite;
    }

    .kc-auth-page::after {
        width: 260px;
        height: 260px;
        bottom: -100px;
        right: -60px;
        background: var(--kc-mustard);
        animation: kc-blob-float 11s ease-in-out infinite reverse;
    }

/* ----------------------------
   2) Zwei-Spalten-Shell
   ---------------------------- */
.kc-auth-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(47, 58, 29, 0.14);
    animation: kc-fade-up 0.55s ease both;
}

/* Einspaltige Variante ohne Bildpanel - für Nebenseiten wie "Passwort vergessen"
   oder "Neues Passwort festlegen", die nicht Teil des Login/Registrieren-Umschalters sind. */
.kc-auth-shell--single {
    grid-template-columns: 1fr;
    max-width: 480px;
}

/* Dekoratives Bildpanel: Rezeptfotos aus wwwroot/images als Sichtfenster in die App */
.kc-auth-visual {
    position: relative;
    min-height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 2.25rem;
    color: #fff;
}

    .kc-auth-visual::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(190deg, rgba(47, 58, 29, 0.15) 0%, rgba(47, 58, 29, 0.85) 100%);
    }

.kc-auth-visual--login {
    background-image: url("../images/muffins.jpg");
}

.kc-auth-visual--register {
    background-image: url("../images/bowl.jpg");
}

.kc-auth-visual-text {
    position: relative;
    z-index: 1;
}

    .kc-auth-visual-text h1 {
        font-size: 1.6rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
    }

    .kc-auth-visual-text p {
        font-size: 0.95rem;
        opacity: 0.9;
        margin: 0;
    }

/* Formular-Seite */
.kc-auth-form-panel {
    padding: 2.75rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.kc-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kc-primary);
    margin-bottom: 0.25rem;
}

.kc-auth-subtitle {
    color: #6b7260;
    font-size: 0.95rem;
    margin-bottom: 1.75rem;
}

/* ----------------------------
   3) Login/Registrieren-Tabs
   ---------------------------- */
.kc-auth-tabs {
    display: flex;
    background: #f1f5e6;
    border-radius: 999px;
    padding: 4px;
    margin-bottom: 2rem;
}

.kc-auth-tab {
    flex: 1;
    text-align: center;
    padding: 0.55rem 0.75rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--kc-primary);
    text-decoration: none;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

    .kc-auth-tab:hover {
        color: var(--kc-primary);
        background: rgba(47, 58, 29, 0.08);
    }

    .kc-auth-tab.active {
        background: var(--kc-primary);
        color: #fff;
        box-shadow: 0 6px 14px rgba(47, 58, 29, 0.25);
    }

/* ----------------------------
   4) Eingabefelder (Floating Label)
   ---------------------------- */
.kc-field {
    position: relative;
    margin-bottom: 1.4rem;
}

.kc-input-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    color: #9aa08c;
    pointer-events: none;
    transition: color 0.2s ease;
}

/* Sichtbar/Verbergen-Umschalter für Passwortfelder (siehe kc-password-toggle.js) -
   rechts im Feld, spiegelbildlich zu .kc-input-icon links. */
.kc-password-toggle {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0.2rem;
    color: #9aa08c;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .kc-password-toggle:hover,
    .kc-password-toggle:focus-visible {
        color: var(--kc-primary);
    }

    .kc-password-toggle .kc-eye-closed {
        display: none;
    }

    .kc-password-toggle.is-visible .kc-eye-open {
        display: none;
    }

    .kc-password-toggle.is-visible .kc-eye-closed {
        display: block;
    }

.kc-input--with-toggle {
    padding-right: 2.75rem;
}

.kc-input {
    width: 100%;
    padding: 1rem 1rem 1rem 2.75rem;
    border: 2px solid #e6e9dc;
    border-radius: 12px;
    font-size: 1rem;
    background: #fafbf6;
    color: var(--kc-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

    .kc-input::placeholder {
        color: transparent;
    }

    .kc-input:focus {
        outline: none;
        border-color: var(--kc-primary);
        background: #fff;
        box-shadow: 0 0 0 4px rgba(47, 58, 29, 0.12);
    }

        .kc-input:focus + .kc-floating-label {
            color: var(--kc-primary);
        }

        .kc-input:focus ~ .kc-input-icon {
            color: var(--kc-primary);
        }

/* Label "schwebt" nach oben, sobald fokussiert oder befüllt */
.kc-floating-label {
    position: absolute;
    left: 2.75rem;
    top: 1rem;
    font-size: 1rem;
    color: #8a8f80;
    background: transparent;
    padding: 0 0.3rem;
    pointer-events: none;
    transition: all 0.2s ease;
}

.kc-input:focus + .kc-floating-label,
.kc-input:not(:placeholder-shown) + .kc-floating-label {
    top: -0.55rem;
    left: 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fff;
    color: var(--kc-primary);
}

/* ----------------------------
   5) Buttons
   ---------------------------- */
.kc-btn-primary {
    display: block;
    width: 100%;
    padding: 0.9rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--kc-primary) 0%, var(--kc-primary-light) 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

    .kc-btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(47, 58, 29, 0.25);
    }

    .kc-btn-primary:active {
        transform: translateY(0);
        filter: brightness(0.95);
    }

    .kc-btn-primary:focus-visible {
        outline: none;
        box-shadow: 0 0 0 0.2rem #fff, 0 0 0 0.35rem var(--kc-primary);
    }

.kc-auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7260;
}

    .kc-auth-switch a {
        color: var(--kc-primary);
        font-weight: 600;
        text-decoration: none;
    }

        .kc-auth-switch a:hover {
            text-decoration: underline;
        }

/* ----------------------------
   6) Fehlermeldung
   ---------------------------- */
.kc-alert-error {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: #fdecec;
    border: 1px solid rgba(214, 48, 49, 0.25);
    color: #a71d1d;
    border-radius: 12px;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: kc-slide-in 0.3s ease both;
}

.kc-alert-icon {
    flex-shrink: 0;
    display: flex;
}

/* ----------------------------
   7) Einblend-Animationen
   ---------------------------- */
@keyframes kc-fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kc-slide-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes kc-blob-float {
    0%, 100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(20px, 25px);
    }
}

/* ----------------------------
   8) Responsive
   ---------------------------- */
@media (max-width: 768px) {
    .kc-auth-page {
        padding: 1.5rem 0.75rem;
        border-radius: 20px;
    }

    .kc-auth-shell {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .kc-auth-visual {
        display: none;
    }

    .kc-auth-form-panel {
        padding: 2rem 1.5rem;
    }
}

/* Nutzer mit "reduced motion"-Einstellung bekommen keine Animationen */
@media (prefers-reduced-motion: reduce) {
    .kc-auth-page::before,
    .kc-auth-page::after,
    .kc-auth-shell,
    .kc-alert-error {
        animation: none;
    }
}
