/* =====================================================================
   Erfolgsmaker – Passwortschutz (Gate CSS)
   Design-Engineering im Erfolgsmaker Dark Theme
   ===================================================================== */

/* 1. Verhindert Flash of Unauthenticated Content (FOUC) */
html.gate-locked body > *:not(#passwordGate) {
    display: none !important;
}

html.gate-locked body {
    overflow: hidden !important;
    background: #090D16 !important;
}

/* 2. Passwort-Gate Overlay */
#passwordGate {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #090D16;
    overflow-y: auto;
    transition: opacity 400ms cubic-bezier(0.23, 1, 0.32, 1), transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* Aurora-Hintergrund im Gate */
#passwordGate::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(55% 45% at 85% 15%, rgba(162, 23, 23, 0.22), transparent 70%),
        radial-gradient(50% 50% at 15% 85%, rgba(162, 23, 23, 0.16), transparent 70%);
}

#passwordGate::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 0%, transparent 80%);
}

/* 3. Gate Card */
.gate-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    padding: clamp(32px, 5vw, 48px);
    border-radius: 28px;
    background: radial-gradient(circle at 90% 0%, rgba(162, 23, 23, 0.2), transparent 40%), rgba(16, 23, 37, 0.94);
    backdrop-filter: blur(28px) saturate(160%);
    -webkit-backdrop-filter: blur(28px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 40px rgba(162, 23, 23, 0.15);
    text-align: center;
    color: #F4F5F7;
    font-family: 'Inter', system-ui, sans-serif;
    transform: translateY(0) scale(1);
    transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1), opacity 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.gate-logo {
    width: auto;
    max-width: 220px;
    height: auto;
    max-height: 58px;
    margin: 0 auto 24px;
    display: block;
    object-fit: contain;
}

.gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 100px;
    background: rgba(162, 23, 23, 0.15);
    border: 1px solid rgba(162, 23, 23, 0.35);
    color: #FF6B6B;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.gate-badge svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.gate-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    color: #FFFFFF;
}

.gate-desc {
    color: #9AA7B8;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* 4. Formular */
.gate-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
}

.gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gate-input {
    width: 100%;
    padding: 14px 48px 14px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: border-color 200ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1), background 200ms ease;
}

.gate-input::placeholder {
    color: #617084;
}

.gate-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #A21717;
    box-shadow: 0 0 0 3px rgba(162, 23, 23, 0.28);
}

.gate-toggle-pwd {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    background: transparent;
    border: none;
    color: #9AA7B8;
    cursor: pointer;
    border-radius: 8px;
    transition: color 180ms ease, background 180ms ease;
}

.gate-toggle-pwd:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.gate-toggle-pwd svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    padding: 14px 24px;
    border-radius: 100px;
    background: linear-gradient(135deg, #A21717, #801212);
    border: none;
    color: #FFFFFF;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(162, 23, 23, 0.4);
    transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), filter 200ms ease, box-shadow 200ms ease;
}

.gate-btn:hover {
    filter: brightness(1.12);
    box-shadow: 0 6px 26px rgba(162, 23, 23, 0.55);
    transform: translateY(-2px);
}

.gate-btn:active {
    transform: scale(0.97);
}

.gate-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Fehlermeldung */
.gate-error {
    color: #FF5A5A;
    font-size: 0.84rem;
    font-weight: 500;
    text-align: center;
    min-height: 20px;
    margin-top: 4px;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 200ms ease, transform 200ms ease;
}

.gate-error.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Shake Animation bei falschem Passwort */
.gate-shake {
    animation: gateShake 380ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes gateShake {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
    40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* 5. Ausblenden beim Entsperren */
.gate-unlocking {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: scale(1.03) !important;
}

.gate-unlocking .gate-card {
    transform: scale(0.94) translateY(12px) !important;
    opacity: 0 !important;
}

.gate-footer-hint {
    margin-top: 24px;
    font-size: 0.78rem;
    color: #617084;
    text-align: center;
}
