/* 
   Atlas-Civ-Clicker | Login System & Auth UX
   Mensch: Diese Datei steuert den ersten Eindruck des Imperiums und den Account-Manager.
   Fokus: Nova v3.8 Glassmorphism, PWA-Optimierung & Safe-Areas.
   KI: @ui-login @pwa-excellence @nova-v3.8 @ui-upgrade
*/

#login-overlay {
    z-index: 2000; /* Höher als Standard-Modals */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    padding: 2.5rem; /* v4.2.1: Mehr Raum für Premium-Look */
    position: relative;
    overflow-y: auto;
    box-shadow: var(--glass-shadow);
}

.login-card {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), inset 0 0 20px rgba(255,255,255,0.05);
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    user-select: none; /* v4.2.1: PWA Native Feel */
    -webkit-user-select: none;
}

/* v4.2.0: Account-Badges Standardisierung (Optimiert für v4.2.1) */
.account-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 16px; /* v4.2.1: Vergrößert für 44px Regel */
    min-height: 44px;    /* v4.2.1: Erfüllt kaiserliche Touch-Vorgabe */
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.account-badge:hover, .account-badge:active {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--color-gold);
    color: var(--color-gold);
    transform: translateY(-2px);
}

.account-badge:active {
    transform: scale(0.98); /* Visuelles Feedback bei Touch */
}

.account-badge .material-symbols-outlined {
    font-size: 1.2rem;
}

/* Loading State für Login-Button */
.btn-loading {
    pointer-events: none;
    opacity: 0.8;
    background: linear-gradient(135deg, #475569, #1e293b) !important;
    box-shadow: none !important;
}

.pulsing {
    animation: pulse-loading 1.5s infinite ease-in-out;
}

@keyframes pulse-loading {
    0% { opacity: 0.5; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 0.5; transform: scale(0.95); }
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
}

.login-form input {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.1rem; /* v4.2.1: Touch-Optimiert */
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.login-form input:focus {
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Spezifische Korrektur für Login-Fehler (Premium v4.2.0 Mapping) */
#login-error.visible {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}
/* v4.0 Account-Manager Integration (from style.css) */
#account-list-container {
    animation: fadeIn 0.5s ease;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.account-badge span {
    font-weight: 600;
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Error Feedback & Animations */
#login-error.visible {
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

/* Inline Error Messages (Modularized from style.css) */
.error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0.5rem;
    height: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.error-msg.visible {
    opacity: 1;
    visibility: visible;
}
