:root {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #311042 100%);
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-border: rgba(255, 255, 255, 0.08);
    --primary: #8b5cf6;
    --primary-hover: #a78bfa;
    --primary-active: #7c3aed;
    --secondary: rgba(255, 255, 255, 0.07);
    --secondary-hover: rgba(255, 255, 255, 0.15);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --error: #ef4444;
    --success: #10b981;
    --shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

/* Contenedores de pantallas */
.screen {
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* Tarjetas (Glassmorphism) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 40px 30px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-card {
    margin-top: 10px;
}

/* Iconos y Logos */
.icon-header {
    font-size: 4rem;
    margin-bottom: 15px;
}

.logo {
    font-size: 5rem;
    margin-bottom: 15px;
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Tipografía */
h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

p {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

.subtitle {
    font-size: 1.05rem;
    margin-bottom: 30px;
}

/* Botones y Controles */
form {
    width: 100%;
}

.input-group {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

input {
    flex-grow: 1;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    color: var(--text-primary);
    padding: 16px 20px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    outline: none;
}

input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-primary);
    border: none;
    border-radius: 16px;
    padding: 16px 30px;
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    background: var(--primary-active);
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-primary);
    border: 2px solid var(--card-border);
    border-radius: 16px;
    padding: 16px 22px;
    font-family: var(--font-main);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-large {
    font-size: 1.35rem;
    padding: 20px 30px;
    border-radius: 20px;
}

/* Cerrar Sesión */
.app-header {
    width: 100%;
    max-width: 520px;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Caja de Estado y Spinner */
.status-box {
    margin-top: 30px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 20px;
    display: flex;
    align-items: center;
    text-align: left;
    gap: 20px;
    animation: fadeIn 0.4s ease;
}

.status-steps {
    flex-grow: 1;
}

.status-steps p {
    margin: 0;
}

#status-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.15rem;
}

#status-subtext {
    font-size: 0.9rem;
    margin-top: 4px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alertas de Mensaje */
.message-box {
    margin-top: 25px;
    border-radius: 16px;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 500;
    animation: fadeIn 0.4s ease;
}

.message-box.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.message-box.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.error-msg {
    color: var(--error);
    margin-top: 15px;
    font-weight: 500;
}

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

/* Adaptación para dispositivos pequeños */
@media (max-width: 480px) {
    .card {
        padding: 30px 20px;
        border-radius: 24px;
    }
    h1 {
        font-size: 1.8rem;
    }
    input {
        padding: 14px 16px;
        font-size: 1.1rem;
    }
    .btn-primary {
        padding: 14px 20px;
        font-size: 1.1rem;
    }
    .btn-secondary {
        padding: 14px 16px;
        font-size: 1rem;
    }
}
