/* Mobile-first styles for CCombox Mobile */
:root {
  --brand: #005eff;
  --brand-600: #1c4dd9;
  --ink: #0b1220;
  --muted: #6b7280;
  --bg: #f8fafc;
  --surface: #ffffff;
  --accent: #06b6d4;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  color: var(--ink);
  background: var(--bg);
}

/* App chrome */
.appbar {
  position: sticky;
  top: 0; z-index: 30;
  height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.0), rgba(0,0,0,0.0)), var(--surface);
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.logo { font-weight: 800; color: var(--brand); letter-spacing: .2px; }
.logo.small { font-size: 14px; }

.view { padding: 12px; min-height: calc(100dvh - 56px); }

/* Drawer */
.drawer {
  position: fixed; inset: 0 auto 0 0; width: 82%; max-width: 360px;
  background: var(--surface);
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 40; box-shadow: 6px 0 30px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid #eee; }
.drawer-nav { display: flex; flex-direction: column; padding: 6px; }
.drawer-nav .nav-link { padding: 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.drawer-nav .nav-link.active { background: rgba(0,94,255,.08); color: var(--brand); font-weight: 700; }
.drawer-footer { margin-top: auto; padding: 12px; border-top: 1px solid #eee; }

.backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.25);
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
  z-index: 20;
}
.backdrop.show { opacity: 1; visibility: visible; }

/* Buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 16px; border-radius: var(--radius);
  background: #e5e7eb; border: none; color: var(--ink); font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--brand); color: white; }
.btn.primary:active { background: var(--brand-600); }
.btn.ghost { background: transparent; border: 1px solid #e5e7eb; }
.btn:disabled, .card.disabled { opacity: .5; filter: grayscale(1); cursor: not-allowed; }

input, select, textarea {
  width: 100%; height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid #e5e7eb; background: white; color: var(--ink); outline: none;
}
label { display: block; font-size: 13px; margin: 8px 2px 6px; color: var(--muted); }
.row { display: flex; gap: 8px; }

.container { max-width: 720px; margin: 0 auto; padding: 8px; }
.list { display: grid; gap: 12px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.06); }

/* Alerts */
.alert { padding: 12px; border-radius: 12px; margin-top: 8px; }
.alert.error { background: #fee2e2; color: #7f1d1d; }
.alert.success { background: #dcfce7; color: #14532d; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* Splash + login sequence */
.auth {
  position: fixed; inset: 0; background: var(--bg); z-index: 50;
  display: grid; place-items: center; padding: 16px;
}
.splash {
  position: absolute; inset: 0; display: grid; place-items: center;
  animation: intro 1.6s ease forwards;
}
.splash-logo {
  font-weight: 900; font-size: 36px; color: white;
  padding: 18px 28px; border-radius: 20px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 20px 60px rgba(0,94,255,.3);
  transform: translateY(0) scale(1);
}
@keyframes intro {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}
.login { opacity: 0; transform: translateY(12px); animation: showLogin .9s ease 1.2s forwards; }
@keyframes showLogin {
  to { opacity: 1; transform: translateY(0); }
}

/* Spinner */
.spinner { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.65); z-index: 60; }
.spinner.hidden { display: none; }
.loader { width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid #e5e7eb; border-top-color: var(--brand); animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Article styles */
article h1 { font-size: 22px; margin: 8px 0 12px; }
article img { width: 100%; height: auto; border-radius: 14px; }
article .meta { color: var(--muted); font-size: 13px; margin-top: -2px; }
article .content { line-height: 1.6; }
.grid.cards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .grid.cards { grid-template-columns: 1fr 1fr; } }
