/* WiFi QR Card — Purple/Teal theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #6C5CE7;
  --primary-dim: rgba(108,92,231,0.12);
  --secondary: #A29BFE;
  --accent: #00CEC9;
  --bg: #1A1A2E;
  --bg-card: #16213E;
  --bg-input: #0F0F23;
  --border: rgba(108,92,231,0.15);
  --text: #E8E4F0;
  --text-dim: #9890B8;
  --text-muted: #5A5380;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, sans-serif;
  --transition: 0.2s ease;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }

.header { border-bottom: 1px solid var(--border); background: rgba(22,33,62,0.95); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 900px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; }
.header-left { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.header h1 { font-size: 1.05rem; font-weight: 700; }
.subtitle { font-size: 0.72rem; color: var(--text-dim); }

.main { max-width: 900px; margin: 0 auto; padding: 20px; }
.layout { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }

.settings-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-header { padding: 8px 14px; border-bottom: 1px solid var(--border); }
.panel-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.settings-body { padding: 14px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.72rem; font-weight: 500; color: var(--text-dim); margin-bottom: 3px; }
.field input, .field select { width: 100%; padding: 6px 8px; font-family: var(--font); font-size: 0.78rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; }
.field input:focus, .field select:focus { border-color: rgba(108,92,231,0.4); }
.field input[type="color"] { height: 32px; padding: 2px; cursor: pointer; }
.toggle-label { font-size: 0.75rem; color: var(--text-dim); display: flex; align-items: center; gap: 6px; cursor: pointer; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; width: 100%; padding: 10px 18px; font-family: var(--font); font-size: 0.85rem; font-weight: 600; border: none; border-radius: 8px; cursor: pointer; transition: all var(--transition); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #5A4BD1); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(108,92,231,0.3); }

.preview-area { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.card-wrapper { padding: 20px; display: flex; justify-content: center; }

.wifi-card { width: 320px; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 32px rgba(0,0,0,0.3); color: #333; }
.card-accent { height: 8px; }
.card-body { padding: 24px; text-align: center; }
.card-icon { font-size: 2rem; margin-bottom: 8px; }
.card-ssid { font-size: 1.2rem; font-weight: 800; color: #1a1a1a; margin-bottom: 12px; }
.card-qr { display: inline-block; margin: 0 auto 12px; }
.card-qr img, .card-qr canvas { display: block; margin: 0 auto; }
.card-instructions { font-size: 0.82rem; color: #666; margin-bottom: 8px; }
.card-password { font-size: 0.78rem; color: #888; }
.card-password strong { color: #333; }

@media print {
  body { background: #fff !important; }
  .header, .settings-panel, .panel-header { display: none !important; }
  .main { padding: 0 !important; }
  .layout { display: block !important; }
  .preview-area { border: none !important; background: none !important; }
  .card-wrapper { padding: 0 !important; }
  .wifi-card { box-shadow: none !important; border: 2px solid #ddd !important; }
}

@media (max-width: 768px) { .layout { grid-template-columns: 1fr; } }
