:root {
    --bg-dark: #0B0F19;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    
    --color-green: #10B981;
    --color-green-glow: rgba(16, 185, 129, 0.4);
    --color-red: #EF4444;
    --color-red-glow: rgba(239, 68, 68, 0.4);
    --color-gray: #475569;
    --color-gray-glow: rgba(71, 85, 105, 0.4);
    
    --font-primary: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

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

/* Decoraciones de Fondo Animadas */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16,185,129,0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(239,68,68,0.1) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.1); }
}

/* Layout Screens */
.app-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism Cards */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 32px;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1, h2 {
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

p {
    color: var(--text-muted);
    font-weight: 300;
    margin-bottom: 24px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Setup Screen */
.user-input-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.user-input-group input {
    font-family: inherit;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
    padding: 16px 20px;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
    text-align: center;
}

.user-input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.user-input-group input:focus {
    border-color: var(--color-green);
    background: rgba(16, 185, 129, 0.07);
}

.btn {
    font-family: inherit;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-user {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    padding: 16px;
    border: 1px solid var(--glass-border);
}

.btn-user:hover, .btn-user:active {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}

/* Main Screen & Semaphore */
#change-user-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    z-index: 10;
}

#change-user-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

#change-user-btn svg {
    width: 20px;
    height: 20px;
}

.status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.semaphore-wrapper {
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

/* The Light Indicator */
.light {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--color-gray);
    box-shadow: 0 0 0 0 var(--color-gray-glow);
    transition: background 0.5s ease, box-shadow 0.5s ease;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.light.loading {
    animation: pulse 1.5s infinite;
}

.light.green {
    background: var(--color-green);
    box-shadow: 0 0 40px 10px var(--color-green-glow);
}

.light.red {
    background: var(--color-red);
    box-shadow: 0 0 40px 10px var(--color-red-glow);
}

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

.status-text-panel h3 {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.status-text-panel p {
    margin-bottom: 0;
    font-size: 1rem;
}

.action-wrapper {
    width: 100%;
}

.btn-primary {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    border-radius: 20px;
    background: var(--color-gray);
    color: rgba(255,255,255,0.5);
}

.btn-primary.green {
    background: linear-gradient(135deg, var(--color-green), #059669);
    color: #fff;
    box-shadow: 0 10px 20px -5px var(--color-green-glow);
}

.btn-primary.red {
    background: linear-gradient(135deg, var(--color-red), #DC2626);
    color: #fff;
    box-shadow: 0 10px 20px -5px var(--color-red-glow);
}

.btn-primary.green:active, .btn-primary.red:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Util Classes */
.hidden { display: none !important; }

#fallback-container {
    margin-top: 16px;
}
.small-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.small-text a {
    color: var(--color-green);
    text-decoration: underline;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 12px 24px;
    border-radius: 100px;
    color: #fff;
    font-weight: 500;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}
