:root {
  --bg: linear-gradient(135deg, #090d16 0%, #111827 100%);
  --glass: rgba(17, 24, 39, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --primary: #4f46e5;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Outfit', sans-serif; }
body { background: var(--bg); color: var(--text); min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 15px; overflow: hidden; }
.app-container { width: 100%; max-width: 420px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 28px; padding: 25px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); display: flex; flex-direction: column; gap: 20px; position: relative; }
.app-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--glass-border); padding-bottom: 15px; }
.brand h1 { font-size: 1.25rem; font-weight: 700; background: linear-gradient(to right, #a5b4fc, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.connection-pill { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; background: rgba(255,255,255,0.05); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--glass-border); margin-top: 4px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: var(--success); box-shadow: 0 0 10px var(--success); animation: pulse 1.5s infinite; }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.settings-trigger { background: transparent; border: none; color: var(--text-muted); cursor: pointer; border-radius: 50%; padding: 6px; transition: 0.2s; }
.settings-trigger:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.status-card { background: rgba(255,255,255,0.02); border: 1px solid var(--glass-border); border-radius: 20px; padding: 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate-visualizer { width: 100px; height: 80px; border: 3px solid rgba(255,255,255,0.15); border-bottom: none; border-radius: 8px 8px 0 0; position: relative; overflow: hidden; background: rgba(0,0,0,0.3); }
.gate-door { width: 100%; height: 100%; background: linear-gradient(180deg, #4f46e5 0%, #312e81 100%); position: absolute; bottom: 0; left: 0; transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1); border-top: 2px solid #818cf8; }
.gate-visualizer.aberto .gate-door { height: 10%; }
.gate-visualizer.fechado .gate-door { height: 100%; }
.gate-visualizer.abrindo .gate-door { height: 10%; animation: shutter-shiver 0.2s infinite; }
.gate-visualizer.fechando .gate-door { height: 100%; animation: shutter-shiver 0.2s infinite; }
.gate-visualizer.parado .gate-door { animation: none; }
.status-info { display: flex; flex-direction: column; gap: 4px; }
.status-label { font-size: 0.65rem; color: var(--text-muted); letter-spacing: 0.1em; font-weight: 500; }
.status-value { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.wifi-indicator { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.control-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { width: 100%; padding: 14px; border-radius: 16px; font-weight: 600; font-size: 0.9rem; border: none; cursor: pointer; transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); color: white; display: flex; justify-content: center; align-items: center; border: 1px solid rgba(255,255,255,0.05); }
.btn-primary { background: linear-gradient(to bottom right, #6366f1, #4f46e5); box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3); }
.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: linear-gradient(to bottom right, #f87171, #ef4444); box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3); }
.btn-warning { background: linear-gradient(to bottom right, #fbbf24, #f59e0b); box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3); }
.btn:active { transform: scale(0.96); opacity: 0.9; }
.setup-sheet { position: absolute; bottom: 0; left: 0; right: 0; background: #0f172a; border-top: 1px solid var(--glass-border); border-radius: 24px 24px 28px 28px; padding: 20px 25px 25px 25px; transform: translateY(100%); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); z-index: 10; }
.setup-sheet.open { transform: translateY(0); }
.setup-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0 auto 15px auto; }
.setup-content h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.setup-desc { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 15px; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-size: 0.75rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.form-group input { width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); padding: 10px 14px; border-radius: 10px; color: white; font-size: 0.9rem; outline: none; }
.form-group input:focus { border-color: var(--primary); }
.setup-actions { display: flex; gap: 10px; margin-top: 15px; }
.btn-save { flex: 2; padding: 12px; background: var(--primary); border: none; border-radius: 12px; color: white; font-weight: 600; cursor: pointer; font-size: 0.85rem; }
.btn-close { flex: 1; padding: 12px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 12px; color: var(--text); font-weight: 600; cursor: pointer; font-size: 0.85rem; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes shutter-shiver { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1px); } }
