/* ============================================================
   METRO PALM – LOGIN PAGE (APPLE STYLE, THEME-AWARE)
   ============================================================ */

/* Loading screen (shared) */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#loading-screen.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
    width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    background: var(--accent); color: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1.5rem;
    animation: loaderPulse 1.2s ease-in-out infinite;
}
.loader-logo i { width: 1.8rem; height: 1.8rem; }
@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.8; }
}
.loader-bar {
    width: 100px; height: 3px; background: var(--border);
    border-radius: 3px; overflow: hidden;
}
.loader-bar-fill {
    width: 0%; height: 100%; background: var(--accent);
    animation: loaderFill 1.4s ease-in-out infinite;
}
@keyframes loaderFill {
    0% { width: 0%; } 50% { width: 100%; } 100% { width: 0%; }
}

/* Centered layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: var(--bg-primary);
}

/* Container – no card on mobile, just balanced spacing */
.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Brand */
.auth-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}
.brand-icon {
    width: 3.5rem; height: 3.5rem; border-radius: 1rem;
    background: var(--accent); color: var(--bg-primary);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.brand-icon i { width: 1.8rem; height: 1.8rem; }
.auth-brand h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; }
.brand-tagline { color: var(--text-muted); margin-top: 0.3rem; font-size: 0.95rem; }

/* Form */
.auth-form { margin-bottom: 1rem; }
.input-group { margin-bottom: 1.25rem; }
.input-label { display: block; margin-bottom: 0.4rem; font-weight: 500; font-size: 0.85rem; color: var(--text-secondary); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .input-icon {
    position: absolute; left: 1rem; width: 1.1rem; height: 1.1rem;
    color: var(--text-muted); pointer-events: none; z-index: 1;
}
.input-wrap input {
    width: 100%; padding: 0.85rem 1rem 0.85rem 2.8rem;
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-size: 1rem; transition: all var(--transition);
}
.input-wrap input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.input-wrap input::placeholder { color: var(--text-muted); }

/* Password toggle */
.password-toggle {
    position: absolute; right: 0.75rem; background: none;
    border: none; color: var(--text-muted); cursor: pointer;
    padding: 0.25rem; display: flex; align-items: center;
    transition: color var(--transition);
}
.password-toggle:hover { color: var(--accent); }
.password-toggle i { width: 1.1rem; height: 1.1rem; }

/* Terms */
.terms-text {
    text-align: center; font-size: 0.8rem; color: var(--text-muted);
    margin: 1.5rem 0 0; line-height: 1.6;
}
.terms-text a { color: var(--accent); text-decoration: underline; font-weight: 500; }

/* Footer */
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: 0.95rem; color: var(--text-muted); }
.accent-link { color: var(--accent); font-weight: 600; }
.accent-link:hover { text-decoration: underline; }

/* OTP Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal-card {
    width: 100%; max-width: 400px;
    background: var(--bg-secondary); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.otp-header { text-align: center; margin-bottom: 1.5rem; }
.otp-icon-wrap {
    width: 3rem; height: 3rem; border-radius: 50%;
    background: var(--bg-tertiary); display: flex;
    align-items: center; justify-content: center;
    margin: 0 auto 0.75rem;
}
.otp-icon-wrap i { width: 1.5rem; height: 1.5rem; color: var(--accent); }
.otp-inputs { display: flex; gap: 0.6rem; justify-content: center; margin: 1.5rem 0; }
.otp-digit {
    width: 2.8rem; height: 3.2rem; text-align: center;
    font-size: 1.4rem; font-weight: 600; font-family: var(--font-mono);
    background: var(--input-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    transition: border-color var(--transition);
}
.otp-digit:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Error */
.error-message { color: var(--danger); font-size: 0.85rem; margin-bottom: 1rem; display: none; text-align: center; }

/* Mobile */
@media (max-width: 480px) {
    .auth-wrapper { padding: 1rem; }
    .auth-container { max-width: 100%; }
    .otp-digit { width: 2.4rem; height: 2.8rem; font-size: 1.2rem; }
    .input-wrap input { padding: 0.8rem 0.8rem 0.8rem 2.5rem; }
}