/* ========================================
   LOGIN PAGE - MOBILE OPTIMIERUNG
   Perfekt optimiert für Handy wie Landingpage
   Nur für screens <= 768px
   ======================================== */

/* ========================================
   BASE RESET
   ======================================== */
html {
    zoom: 1 !important;
}

html, body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* ========================================
   AUTH PAGE CONTAINER
   ======================================== */
.auth-page {
    min-height: 100vh !important;
    min-height: 100dvh !important; /* Dynamic viewport height for mobile browsers */
    padding: 1.25rem 1rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ========================================
   AUTH CONTAINER
   ======================================== */
.auth-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

/* ========================================
   AUTH CARD - Glassmorphism optimiert
   ======================================== */
.auth-card {
    padding: 1.75rem 1.25rem !important;
    border-radius: 24px !important;
    width: 100% !important;
    max-width: 100% !important;
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
}

/* ========================================
   NAVIGATION - Logo & Back Link
   ======================================== */
.auth-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 1rem !important;
    padding-bottom: 1.25rem !important;
    margin-bottom: 1.25rem !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
}

/* Logo */
.auth-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.logo-icon-modern img {
    width: 36px !important;
    height: 36px !important;
}

.logo-text {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
}

/* Back Link */
.back-link {
    padding: 0.6rem 1.25rem !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
    background: rgba(245, 245, 247, 0.8) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    transition: all 0.2s ease !important;
}

.back-link:active {
    transform: scale(0.98) !important;
    background: rgba(235, 235, 240, 0.9) !important;
}

.back-link span:first-child {
    font-size: 1.1rem !important;
}

/* ========================================
   AUTH HEADER
   ======================================== */
.auth-header {
    margin-bottom: 1.5rem !important;
    text-align: center !important;
}

.auth-header h1 {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
    letter-spacing: -0.02em !important;
    background: linear-gradient(135deg, #1d1d1f 0%, #3d3d3f 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.auth-header p {
    font-size: 0.95rem !important;
    color: #6b7280 !important;
    line-height: 1.5 !important;
}

/* ========================================
   ALERT MESSAGES
   ======================================== */
.alert-message {
    padding: 0.85rem 1rem !important;
    font-size: 0.9rem !important;
    border-radius: 12px !important;
    margin-bottom: 1.25rem !important;
    gap: 0.5rem !important;
}

.alert-message span:first-child {
    font-size: 1.1rem !important;
}

/* ========================================
   FORM GROUPS
   ======================================== */
.form-group {
    margin-bottom: 1.25rem !important;
}

.form-group label {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin-bottom: 0.5rem !important;
    color: #374151 !important;
}

/* ========================================
   FORM INPUTS - Touch Optimiert
   ======================================== */
.form-input {
    padding: 1rem 1.1rem !important;
    font-size: 16px !important; /* Verhindert iOS Zoom */
    border-radius: 14px !important;
    min-height: 54px !important;
    border: 1.5px solid #e5e7eb !important;
    background: rgba(255, 255, 255, 0.95) !important;
    transition: all 0.2s ease !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.form-input::placeholder {
    color: #9ca3af !important;
    font-size: 0.95rem !important;
}

.form-input:focus {
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12) !important;
    background: #ffffff !important;
}

/* ========================================
   PASSWORD WRAPPER
   ======================================== */
.password-wrapper {
    position: relative !important;
}

.password-toggle {
    position: absolute !important;
    right: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    padding: 0.75rem !important;
    font-size: 1.35rem !important;
    min-width: 48px !important;
    min-height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    transition: background 0.2s ease !important;
}

.password-toggle:active {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* ========================================
   FORM FOOTER - Forgot Password
   ======================================== */
.form-footer {
    margin-top: 0.75rem !important;
    display: flex !important;
    justify-content: flex-end !important;
}

.forgot-link {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    padding: 0.5rem 0 !important;
    color: #3B82F6 !important;
}

.forgot-link:active {
    color: #2563EB !important;
}

/* ========================================
   SUBMIT BUTTON - CTA
   ======================================== */
.submit-btn {
    width: 100% !important;
    padding: 1.1rem 1.5rem !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    border-radius: 14px !important;
    min-height: 56px !important;
    margin-top: 0.5rem !important;
    background: linear-gradient(135deg, #FF1B8D 0%, #8B5CF6 50%, #3B82F6 100%) !important;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3) !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.01em !important;
}

.submit-btn:active:not(:disabled) {
    transform: scale(0.98) !important;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.25) !important;
}

.submit-btn:disabled {
    opacity: 0.65 !important;
    transform: none !important;
}

/* ========================================
   AUTH FOOTER - Sign Up Link
   ======================================== */
.auth-footer {
    margin-top: 1.5rem !important;
    font-size: 0.95rem !important;
    text-align: center !important;
    color: #6b7280 !important;
}

.auth-footer a {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: #3B82F6 !important;
}

.auth-footer a:active {
    color: #2563EB !important;
}

/* ========================================
   KLEINERE SCREENS (480px und kleiner)
   ======================================== */
@media (max-width: 480px) {
    .auth-page {
        padding: 1rem 0.75rem !important;
    }

    .auth-card {
        padding: 1.5rem 1rem !important;
        border-radius: 20px !important;
    }

    .auth-header h1 {
        font-size: 1.6rem !important;
    }

    .form-input {
        padding: 0.9rem 1rem !important;
        min-height: 52px !important;
    }

    .submit-btn {
        padding: 1rem 1.25rem !important;
        min-height: 52px !important;
        font-size: 1rem !important;
    }

    .auth-nav {
        gap: 0.85rem !important;
    }

    .logo-icon-modern img {
        width: 32px !important;
        height: 32px !important;
    }

    .logo-text {
        font-size: 1.25rem !important;
    }
}

/* ========================================
   SEHR KLEINE SCREENS (360px und kleiner)
   ======================================== */
@media (max-width: 360px) {
    .auth-page {
        padding: 0.75rem 0.5rem !important;
    }

    .auth-card {
        padding: 1.25rem 0.85rem !important;
    }

    .auth-header h1 {
        font-size: 1.45rem !important;
    }

    .auth-header p {
        font-size: 0.9rem !important;
    }

    .form-group label {
        font-size: 0.85rem !important;
    }

    .back-link {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
    }
}

/* ========================================
   LANDSCAPE MODE
   ======================================== */
@media (max-height: 550px) and (orientation: landscape) {
    .auth-page {
        padding: 0.75rem 1rem !important;
        align-items: flex-start !important;
        overflow-y: auto !important;
    }

    .auth-card {
        padding: 1.25rem 1.5rem !important;
    }

    .auth-nav {
        flex-direction: row !important;
        justify-content: space-between !important;
        padding-bottom: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }

    .auth-header {
        margin-bottom: 1rem !important;
    }

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

    .form-group {
        margin-bottom: 0.85rem !important;
    }

    .form-input {
        min-height: 48px !important;
        padding: 0.75rem 1rem !important;
    }

    .submit-btn {
        min-height: 48px !important;
        padding: 0.85rem 1.25rem !important;
    }
}

/* ========================================
   SAFE AREA - iPhone Notch/Home Indicator
   ======================================== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .auth-page {
        padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)) !important;
        padding-left: calc(1rem + env(safe-area-inset-left)) !important;
        padding-right: calc(1rem + env(safe-area-inset-right)) !important;
    }
}

/* ========================================
   ACCESSIBILITY - FOCUS STATES
   ======================================== */
.form-input:focus,
.submit-btn:focus,
.back-link:focus,
.forgot-link:focus,
.password-toggle:focus {
    outline: none !important;
}

/* Visible focus für Keyboard-Navigation */
.form-input:focus-visible,
.submit-btn:focus-visible,
.back-link:focus-visible {
    outline: 2px solid #3B82F6 !important;
    outline-offset: 2px !important;
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ========================================
   DARK MODE SUPPORT (falls gewünscht)
   ======================================== */
@media (prefers-color-scheme: dark) {
    /* Kann später hinzugefügt werden */
}
