/* =========================================================
   GLOBAL BASE STYLES — Coro Layout 2026
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-900: #0f1117;
  --bg-800: #161b27;
  --bg-700: #1e2535;
  --bg-600: #252d40;
  --bg-500: #2d3650;
  --border: #2e3a52;
  --border-light: #3d4d6a;
  --text-100: #f0f4ff;
  --text-200: #c8d4ec;
  --text-400: #8ca0c0;
  --text-600: #566a8a;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-glow: rgba(59,130,246,0.25);
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-glow: rgba(239,68,68,0.2);
  --success: #22c55e;
  --warning: #eab308;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --font: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 150ms ease;
}

html, body { height: 100%; overflow: hidden; }
body { font-family: var(--font); background: var(--bg-900); color: var(--text-100); -webkit-font-smoothing: antialiased; }

/* --- Typography --- */
h1, h2, h3 { font-weight: 700; line-height: 1.2; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-glow); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: var(--bg-600); color: var(--text-200); font-size: 13px; font-weight: 500;
  border: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition);
}
.btn-secondary:hover { background: var(--bg-500); }

.btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  background: transparent; color: var(--danger); font-size: 13px; font-weight: 600;
  border: 1px solid var(--danger); cursor: pointer; transition: background var(--transition), box-shadow var(--transition);
}
.btn-danger:hover { background: var(--danger-glow); box-shadow: 0 0 0 3px var(--danger-glow); }

.w-full { width: 100%; }

/* --- Form elements --- */
.form-label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-400);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: var(--bg-900); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; color: var(--text-100);
  font-family: var(--font); transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ca0c0' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* --- Modal --- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 150ms ease;
}
.modal-box {
  background: var(--bg-700); border: 1px solid var(--border-light); border-radius: var(--radius-lg);
  width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); animation: slideUp 200ms ease;
}
.modal-box--danger { border-color: var(--danger); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  background: none; border: none; cursor: pointer; color: var(--text-400);
  padding: 4px; border-radius: var(--radius-sm); transition: color var(--transition), background var(--transition);
}
.modal-close:hover { color: var(--text-100); background: var(--bg-600); }
.modal-body { padding: 24px; }
.modal-body p { font-size: 14px; color: var(--text-200); line-height: 1.6; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 2000;
  background: var(--bg-700); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--text-100);
  box-shadow: var(--shadow-lg); transform: translateY(80px); opacity: 0;
  transition: transform 300ms ease, opacity 300ms ease; pointer-events: none;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.toast--success { border-left: 4px solid var(--success); }
.toast.toast--error { border-left: 4px solid var(--danger); }

/* --- Spinner --- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border-light);
  border-top-color: var(--accent); border-radius: 50%; animation: spin 700ms linear infinite;
}

/* --- State messages --- */
.state-message {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 80px 20px; color: var(--text-400); font-size: 14px; text-align: center;
}
.state-message h3 { font-size: 18px; color: var(--text-200); }

/* --- Animations --- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
