/**
 * Auth-spezifische Styles
 * Für Login, Signup und verwandte Seiten
 * Zweispaltiges Layout: Bild links, Formular rechts
 */

/* ========== AUTH LAYOUT ========== */

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 680px;
    border-radius: 24px;
    overflow: hidden;
    background: #1c1c1f;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: authSlideUp 0.6s ease-out;
}

/* ========== BILD-PANEL (Links) ========== */

.auth-image-panel {
    flex: 1;
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80');
    background-size: cover;
    background-position: center;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.auth-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: 1;
}

.auth-image-content {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.auth-image-logo {
    margin-bottom: auto;
}

.auth-logo-full {
    height: 40px;
    width: auto;
    display: block;
}

.auth-image-text {
    margin-top: auto;
}

.auth-image-text h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.auth-image-text p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Signup: Anderes Bild (Panel ist rechts per HTML-Reihenfolge) */
.auth-image-panel--signup {
    background-image: url('https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=800&q=80');
}

/* Verifizierung: Eigenes Bild */
.auth-image-panel--verify {
    background-image: url('https://images.unsplash.com/photo-1516796181074-bf453fbfa3e6?w=800&q=80');
}

/* Passwort vergessen / zurücksetzen: Eigenes Bild */
.auth-image-panel--password {
    background-image: url('https://images.unsplash.com/photo-1499244571948-7ccddb3583f1?w=800&q=80');
}

/* ========== FORMULAR-PANEL (Rechts) ========== */

.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem;
    background: #1c1c1f;
    max-width: 540px;
}

.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header.text-center {
    text-align: center;
}

.auth-form-header h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-form-header p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0;
}

/* ========== AUTH FORM ELEMENTS ========== */

.auth-form-group {
    margin-bottom: 1.25rem;
}

.auth-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.auth-form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
    font-family: inherit;
}

.auth-form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.auth-form-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.05);
}

/* Input Wrapper für Passwort-Toggle */
.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper .auth-form-input {
    padding-right: 2.75rem;
}

.auth-pw-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.05rem;
    line-height: 1;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-pw-toggle:hover {
    color: rgba(255, 255, 255, 0.6);
}

.auth-pw-toggle.active {
    color: rgba(255, 255, 255, 0.7);
}

/* Validation States */
.auth-form-input.is-invalid {
    border-color: #ff3b30 !important;
    border-width: 2px !important;
}

.auth-form-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.1) !important;
}

.auth-form-input.is-valid {
    border-color: #198754 !important;
}

/* ========== AUTH CHECKBOX ========== */

.auth-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    position: relative;
}

.auth-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.auth-checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 1px;
}

.auth-checkbox-custom::after {
    content: '';
    width: 10px;
    height: 10px;
    background: #e8e6e3;
    border-radius: 3px;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s ease;
}

.auth-checkbox:checked + .auth-checkbox-custom {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.auth-checkbox:checked + .auth-checkbox-custom::after {
    opacity: 1;
    transform: scale(1);
}

.auth-checkbox:focus-visible + .auth-checkbox-custom {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.auth-checkbox-label.is-invalid .auth-checkbox-custom {
    border-color: #ff3b30 !important;
}

.auth-checkbox-text {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.5;
}

.auth-checkbox-text a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-checkbox-text a:hover {
    color: #fff;
}

/* ========== AUTH LINKS ========== */

.auth-forgot-link {
    display: block;
    text-align: right;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.auth-forgot-link:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

/* ========== AUTH BUTTONS ========== */

.auth-btn-primary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: none;
    background: #e8e6e3;
    color: #000;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.auth-btn-primary:hover,
.auth-btn-primary:focus,
.auth-btn-primary:active {
    background: #fff;
    color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(232, 230, 227, 0.2);
}

.auth-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.auth-btn-secondary {
    width: 100%;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.auth-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Button-Gruppe für Multi-Step (Zurück + Weiter) */
.auth-btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.auth-btn-group .auth-btn-primary,
.auth-btn-group .auth-btn-secondary {
    flex: 1;
}

/* ========== AUTH FOOTER LINKS ========== */

.auth-footer-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

.auth-footer-link a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-footer-link a:hover {
    color: #fff;
    text-decoration: none;
}

/* ========== SIGNUP MULTI-STEP ========== */

/* Signup Steps - nur aktiver Step ist sichtbar */
.signup-step {
    display: none;
}

.signup-step.active {
    display: block;
    animation: authFadeIn 0.3s ease-in;
}

/* Stepper – Punkte mit Verbindungslinien */
.auth-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    color: transparent;
    transition: all 0.35s ease;
    flex-shrink: 0;
    position: relative;
}

.step-indicator.active {
    width: 12px;
    height: 12px;
    background: #e8e6e3;
    box-shadow: 0 0 0 4px rgba(232, 230, 227, 0.15);
}

.step-indicator.completed {
    background: rgba(255, 255, 255, 0.45);
}

/* Verbindungslinien zwischen den Dots */
.step-line {
    flex: 1;
    height: 2px;
    max-width: 60px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.step-line .step-line-fill {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.step-line.filled .step-line-fill {
    transform: scaleX(1);
}

/* Step Heading innerhalb des Formulars */
.auth-step-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-step-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.35rem;
}

.auth-step-header p {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0;
}

/* Password Hint */
.auth-password-hint {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 0.5rem;
}

/* ========== PASSWORD STRENGTH INDICATOR ========== */

.pw-strength {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pw-strength.visible {
    opacity: 1;
}

.pw-strength-bar {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.pw-strength-fill {
    height: 100%;
    width: 0%;
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
}

.pw-strength-fill[data-level="0"] {
    width: 0%;
    background: transparent;
}

.pw-strength-fill[data-level="1"] {
    width: 20%;
    background: #ff3b30;
}

.pw-strength-fill[data-level="2"] {
    width: 40%;
    background: #ff9500;
}

.pw-strength-fill[data-level="3"] {
    width: 60%;
    background: #ffcc00;
}

.pw-strength-fill[data-level="4"] {
    width: 80%;
    background: #34c759;
}

.pw-strength-fill[data-level="5"] {
    width: 100%;
    background: #30d158;
}

.pw-strength-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
    transition: color 0.3s ease;
}

.pw-strength-label[data-level="1"] { color: #ff3b30; }
.pw-strength-label[data-level="2"] { color: #ff9500; }
.pw-strength-label[data-level="3"] { color: #ffcc00; }
.pw-strength-label[data-level="4"] { color: #34c759; }
.pw-strength-label[data-level="5"] { color: #30d158; }

/* Password Rules Checklist */
.pw-rules {
    list-style: none;
    padding: 0;
    margin: 0.6rem 0 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 1rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.4s ease, margin 0.3s ease;
}

.pw-rules.visible {
    opacity: 1;
    max-height: 120px;
    margin-top: 0.6rem;
}

.pw-rules li {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.25s ease;
}

.pw-rules li.met {
    color: #34c759;
}

.pw-rules li .pw-rule-icon {
    font-size: 0.65rem;
    transition: all 0.25s ease;
}

/* ========== VERIFY PAGE ========== */

/* Code-Input speziell für Verifizierung */
.auth-verify-code-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0.875rem 1rem;
}

.auth-verify-code-input::placeholder {
    letter-spacing: 4px;
    font-size: 1rem;
    font-weight: 400;
}

/* Icon-States für Fehlermeldungen */
.auth-verify-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.auth-verify-icon--warning {
    background: rgba(255, 149, 0, 0.12);
    color: #ff9500;
}

.auth-verify-icon--error {
    background: rgba(255, 59, 48, 0.12);
    color: #ff3b30;
}

/* Erneut senden Bereich */
.auth-verify-resend {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-verify-resend-text {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 0.75rem;
}

/* Text-Button (Link-Style) */
.auth-btn-link {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.auth-btn-link:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.05);
}

.auth-btn-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== ALERT CONTAINER ========== */

.auth-form-panel #alert-container {
    margin-bottom: 1rem;
}

/* ========== LEGAL LINKS (unter der Auth-Karte) ========== */

.auth-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-shrink: 0;
    width: 100%;
}

.auth-legal-links a {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-legal-links a:hover {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}

.auth-legal-divider {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.15);
    user-select: none;
}

/* ========== LEGAL PAGES ========== */

.legal-page {
    width: 100%;
    max-width: 720px;
    padding: 2.5rem;
    animation: authSlideUp 0.6s ease-out;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

.legal-back-link:hover {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

.legal-page h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.legal-updated {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 2.5rem;
}

.legal-content h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.legal-content p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ========== ANIMATIONS ========== */

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========== RESPONSIVE ========== */

/* Desktop: Mobile-Elemente ausblenden, Header linksbündig */
@media (min-width: 993px) {
    .auth-logo-mobile {
        display: none;
    }

    .auth-form-header {
        text-align: left;
    }
}

/* Tablet: Bild-Panel ausblenden */
@media (max-width: 992px) {
    .auth-wrapper {
        padding: 1rem;
    }

    .auth-container {
        max-width: 480px;
        min-height: auto;
        margin: 0 auto;
    }

    .auth-image-panel {
        display: none;
    }

    .auth-form-panel {
        max-width: 100%;
        padding: 2.5rem;
    }

    .legal-page {
        padding: 2rem 1.5rem;
    }

    .auth-logo-mobile {
        height: 48px;
        width: auto;
        display: block;
        margin: 0 auto 1.5rem;
        opacity: 0.9;
    }

    .auth-form-header {
        text-align: center;
    }
}

/* Mobile: Kompakter */
@media (max-width: 576px) {
    .auth-wrapper {
        padding: 1rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .auth-container {
        border-radius: 20px;
        margin: 0 auto;
    }

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

    .auth-form-header h1 {
        font-size: 1.35rem;
    }

    .auth-form-input {
        padding: 0.7rem 0.875rem;
    }

    .step-indicator {
        width: 8px;
        height: 8px;
    }

    .step-indicator.active {
        width: 10px;
        height: 10px;
    }

    .step-line {
        max-width: 40px;
    }

    .auth-legal-links {
        margin-top: 1rem;
    }

    .legal-page {
        padding: 1.5rem 1rem;
    }

    .legal-page h1 {
        font-size: 1.4rem;
    }

    .legal-content h2 {
        font-size: 0.95rem;
    }

    .legal-content p {
        font-size: 0.85rem;
    }
}
