/* ========================================================================
   AUTH UNIFIED CSS
   Einheitliches Styling für ALLE Auth-Seiten:
   login, register, activate, 2fa_verify, pending_approval,
   reset_password, verify, forgot_password
   ======================================================================== */

/* --- AUTH PAGE BODY OVERRIDE --- */
body.auth-page .container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100dvh - 40px);
    padding: 20px;
    max-width: 100%;
}

/* --- AUTH CARD (Moved from tables.css) --- */
.auth-card {
    width: 100%;
    max-width: 450px;
    margin: 40px auto;
    background: var(--glass-bg, rgba(255, 255, 255, 0.65));
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: var(--glass-border, 1px solid rgba(255, 255, 255, 0.6));
    border-radius: 32px;
    padding: 50px 40px;
    box-shadow: var(--shadow-soft, 0 15px 40px -10px rgba(190, 18, 60, 0.08));
    text-align: center;
    position: relative;
    animation: slideInAuth 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 35px 25px;
        border-radius: 24px;
    }
}

/* --- HEADER / LOGO --- */
.auth-card .auth-header {
    margin-bottom: 35px;
}

.auth-card .logo-img {
    width: 80px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.auth-card .brand-logo {
    width: 90px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
}

.auth-card .subtitle {
    color: #888;
    font-size: 1rem;
    font-weight: 300;
}

/* --- FORM GRID --- */
.auth-card .form-grid {
    display: grid;
    gap: 0;
    text-align: left;
}

.auth-card .form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* --- AUTH CHECKBOX (Moved from forms.css) --- */
.auth-card .auth-checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--text-main, #4c0519);
    font-size: 0.95rem;
}

.auth-card .auth-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    min-width: 22px;
    max-width: 22px;
    min-height: 22px;
    max-height: 22px;
    aspect-ratio: 1 / 1;
    margin: 0;
    padding: 0;
    border: 2px solid var(--rose-300, #fda4af);
    border-radius: 50%;
    flex-shrink: 0;
    background-color: transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
}

.auth-card .auth-checkbox:hover {
    border-color: var(--rose-400, #fb7185);
}

.auth-card .auth-checkbox:checked {
    background-color: var(--accent, #be123c);
    border-color: var(--accent, #be123c);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-card .auth-checkbox:focus {
    outline: none;
    box-shadow: none;
}

.auth-card .auth-checkbox:focus-visible {
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.15);
}

@media (hover: none) {
    .auth-card .auth-checkbox:hover {
        border-color: var(--rose-300, #fda4af);
    }
}

@media (max-width: 768px) {
    .auth-card .auth-checkbox {
        border-radius: 50%;
        aspect-ratio: 1 / 1;
    }
}

/* --- ERROR MESSAGE --- */
.auth-card .error-msg {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #fecaca;
    text-align: left;
}

/* --- SUCCESS MESSAGE --- */
.auth-card .success-msg {
    background: #dcfce7;
    color: #166534;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #bbf7d0;
    text-align: left;
}

.auth-card .success-msg-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #16a34a;
}

/* --- BUTTONS --- */
.auth-card .btn-submit {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 50px;
    background: var(--rose-900, #881337);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: var(--font-main);
    letter-spacing: 0.5px;
    box-shadow: 0 10px 25px rgba(136, 19, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth-card .btn-submit:hover {
    background: #700f2b;
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(136, 19, 55, 0.3);
}

.auth-card .btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- FOOTER LINKS --- */
.auth-card .auth-footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.9rem;
    color: #666;
}

.auth-card .auth-footer a {
    color: var(--rose-900, #881337);
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
}

.auth-card .auth-footer a:hover {
    opacity: 0.7;
}

.auth-card .forgot-link {
    display: block;
    text-align: right;
    margin-top: -6px;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
}

.auth-card .forgot-link:hover {
    text-decoration: underline;
    color: var(--rose-700, #be123c);
}

.auth-card .auth-footer-link {
    font-weight: 400;
    font-size: 0.85rem;
    margin-top: 15px;
    display: inline-block;
    opacity: 0.8;
    text-decoration: none;
    color: inherit;
}

/* --- SUCCESS & STATUS CARDS --- */
.auth-card .success-card {
    text-align: center;
    padding: 20px 0;
}

.auth-card .success-icon {
    width: 70px;
    height: 70px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px auto;
}

.auth-card .status-icon-container {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.auth-card .status-icon-container.success {
    background: #dcfce7;
    color: #166534;
}

.auth-card .status-icon-container.error {
    background: #fee2e2;
    color: #b91c1c;
}

.auth-card .icon-success {
    background: #dcfce7;
    color: #166534;
}

.auth-card .icon-error {
    background: #fee2e2;
    color: #b91c1c;
}

.auth-card .status-icon {
    width: 32px;
    height: 32px;
}

.auth-card .status-icon-large {
    width: 40px;
    height: 40px;
}

.auth-card .status-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.auth-card .status-title.success {
    color: #166534;
}

.auth-card .status-title.error {
    color: #b91c1c;
}

.auth-card .status-desc {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* --- AUTH TYPOGRAPHY --- */
.auth-card .auth-title {
    font-family: var(--font-serif);
    color: var(--rose-900, #881337);
    margin-bottom: 20px;
    font-size: 2.2rem;
    line-height: 1.1;
}

.auth-card .auth-desc {
    color: #666;
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 35px;
    font-weight: 300;
}

/* --- ANIMATED ICON (pending_approval) --- */
.auth-card .icon-pulse-container {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    color: var(--rose-700, #be123c);
}

.auth-card .icon-pulse {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
    animation: pulse 2s infinite ease-in-out;
    transform-origin: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* --- ICON CIRCLE (2fa_verify) --- */
.auth-card .icon-circle {
    width: 70px;
    height: 70px;
    background: #fff0f5;
    color: var(--accent, #be123c);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px auto;
    box-shadow: 0 4px 10px rgba(190, 18, 60, 0.1);
}

/* --- 2FA OTP INPUT --- */
.auth-card .otp-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.auth-card .otp-input {
    width: 100%;
    max-width: 45px;
    height: 55px;
    padding: 0 !important;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    border-radius: 12px;
    border: 1px solid rgba(190, 18, 60, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: var(--accent, #be123c);
    font-family: monospace;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    outline: none;
}

.auth-card .otp-input:focus {
    background: white;
    border-color: var(--accent, #be123c);
    box-shadow: 0 0 0 4px rgba(190, 18, 60, 0.1);
    transform: translateY(-2px);
}

.auth-card .otp-input::placeholder {
    color: #e5e7eb;
}

/* --- CHECKBOX (Remember Me) --- */
.auth-card .auth-checkbox-container-wrapper {
    display: none;
    text-align: left;
    margin-top: 15px;
    margin-bottom: 5px;
}

/* --- MISC LINKS --- */
.auth-card .auth-links {
    font-size: 0.8rem;
    color: #666;
    text-align: center;
    margin-top: 25px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.auth-card .auth-links a {
    color: var(--rose-900, #881337);
    font-weight: 600;
    text-decoration: none;
}

.auth-card .cancel-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--text-muted, #9f1239);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.auth-card .cancel-link:hover {
    color: var(--text-main, #4c0519);
}

/* --- PASSWORD REQUIREMENTS --- */
.auth-card .password-requirements {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 0 5px;
    flex-wrap: wrap;
}

.auth-card .req-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #94a3b8;
    transition: color 0.3s;
}

.auth-card .req-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background 0.3s;
}

.auth-card .req-item.valid {
    color: #16a34a;
}

.auth-card .req-item.valid .req-dot {
    background: #16a34a;
}

.auth-card .req-item.invalid {
    color: #dc2626;
}

.auth-card .req-item.invalid .req-dot {
    background: #dc2626;
}

/* --- HONEYPOT BOT TRAP --- */
.auth-card .bot-trap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    z-index: -1;
}

/* --- ANIMATION --- */
@keyframes slideInAuth {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

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

/* ==========================================================
   THE NUCLEAR IOS SAFARI AUTOFILL FIX
   Zerstört das Apple Shadow DOM und erzwingt Hardware-Rendering
========================================================== */
.input-group .input-field {
    -webkit-appearance: none !important;
    appearance: none !important;
    transform: translateZ(0) !important;
    /* Zwingt iOS zum sofortigen, exakten Rendering */
    padding-left: 20px !important;
    /* Dein Standard-Padding */
    margin: 0 !important;
}

/* 1. Apples unsichtbare Autofill-Icons gnadenlos aus dem Feld verbannen */
.input-group .input-field::-webkit-contacts-auto-fill-button,
.input-group .input-field::-webkit-credentials-auto-fill-button,
.input-group .input-field::-webkit-strong-password-auto-fill-button {
    display: none !important;
    position: absolute !important;
    right: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* 2. Den Autofill-Text knallhart auf der linken Kante verankern */
.input-group .input-field:-webkit-autofill,
.input-group .input-field:-webkit-autofill:hover,
.input-group .input-field:-webkit-autofill:focus,
.input-group .input-field:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px white inset !important;
    /* Blockt iOS Hintergrundfarben */
    -webkit-text-fill-color: var(--rose-900) !important;
    transition: background-color 5000s ease-in-out 0s !important;
    padding-left: 20px !important;
    /* Muss exakt das gleiche Padding sein wie oben! */
    text-indent: 0 !important;
    caret-color: var(--accent) !important;
}

/* 3. Floating Label Fix (Falls du placeholder="" genutzt hast, mach wieder placeholder=" " rein!) */
.input-group .input-field:not(:placeholder-shown)+.input-label,
.input-group .input-field:-webkit-autofill+.input-label {
    top: 0 !important;
    left: 20px !important;
}

/* ==========================================================
   PENDING APPROVAL CUSTOM CARD & CTA BUTTONS
   ========================================================== */
.pending-approval-card {
    max-width: 500px !important;
}

.cta-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
    margin-bottom: 15px;
}

.btn-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-main);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.btn-whatsapp {
    background: white;
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.2);
    box-shadow: 0 4px 12px rgba(21, 128, 61, 0.03);
}

.btn-whatsapp:hover {
    background: #f0fdf4;
    border-color: #bbf7d0;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(21, 128, 61, 0.08);
}

.btn-phone {
    background: white;
    color: var(--rose-900, #881337);
    border: 1px solid rgba(136, 19, 55, 0.15);
    box-shadow: 0 4px 12px rgba(136, 19, 55, 0.05);
}

.btn-phone:hover {
    background: var(--rose-50, #fff1f2);
    border-color: var(--rose-200, #fecdd3);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(136, 19, 55, 0.08);
}

.back-dashboard-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.back-dashboard-link:hover {
    color: var(--rose-900, #881337);
}

/* ==========================================================
   EINWILLIGUNG / PHOTO CONSENT PAGE CUSTOM ADDITIONS
   ========================================================== */
.auth-card .progress-bar {
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    margin-bottom: 30px;
    overflow: hidden;
}

.auth-card .progress-fill {
    height: 100%;
    background: var(--rose-900, #881337);
    transition: width 0.5s ease;
}

.auth-card .pin-input {
    text-align: center;
    letter-spacing: 12px;
    font-size: 24px !important;
    font-weight: 700;
}

.auth-card .canvas-container {
    border: 1px solid rgba(190, 18, 60, 0.2);
    border-radius: 16px;
    background: #ffffff;
    overflow: hidden;
    touch-action: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.auth-card canvas {
    width: 100%;
    height: 180px;
    cursor: crosshair;
    display: block;
}

.auth-card .btn-clear {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 0;
    transition: color 0.3s;
    display: inline-block;
}