/* ============================================
   Dinezzo 2.0 — Auth pages (login + admin)
   ============================================ */

:root {
  --navy-900: #0f1626;
  --navy-800: #1a2238;
  --navy-700: #232c47;
  --navy-600: #2f3a5a;
  --navy-500: #4a5573;
  --navy-400: #6b7693;
  --navy-300: #8e98b3;
  --navy-200: #c2c8d8;
  --navy-100: #e3e6ef;
  --navy-50:  #f3f4f8;
  --coral-500: #ff5e6c;
  --coral-600: #ef3344;
  --coral-50:  #fff1f2;
  --cream:     #fbfaf7;
  --line:      rgba(26, 34, 56, 0.12);

  --font-sans: 'Inter', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--navy-900);
  background: var(--cream);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
a { color: var(--coral-600); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Background ---------- */
.auth-bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 50% at 20% 20%, rgba(255, 94, 108, 0.18), transparent 70%),
    radial-gradient(50% 40% at 85% 80%, rgba(255, 138, 138, 0.18), transparent 70%),
    var(--cream);
}
.auth-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.6;
}

/* ---------- Login layout ---------- */
.auth-body { display: flex; min-height: 100vh; }
.auth-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px;
  gap: 18px;
  position: relative;
  z-index: 1;
}
.auth-logo img { width: 120px; height: auto; }
.auth-back { color: var(--navy-500); font-size: 13px; margin-top: 4px; }
.auth-back:hover { color: var(--navy-900); text-decoration: none; }

.auth-card {
  width: 100%; max-width: 420px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 30px 60px -20px rgba(15, 22, 38, 0.18);
}
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  background: var(--navy-50); border-radius: 10px; padding: 4px;
  margin-bottom: 24px;
}
.auth-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 13.5px; font-weight: 600;
  color: var(--navy-500); background: transparent; border: none; cursor: pointer;
  transition: background .2s, color .2s;
}
.auth-tab.is-active { background: white; color: var(--navy-900); box-shadow: 0 1px 3px rgba(15,22,38,0.1); }
.auth-tab svg { opacity: 0.7; }

.auth-title { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.02em; }
.auth-sub { color: var(--navy-500); font-size: 14.5px; margin: 0 0 24px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy-700); }
.auth-form input {
  height: 46px; padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit; font-size: 15px; color: var(--navy-900);
  background: white;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.auth-form input:focus { border-color: var(--coral-500); box-shadow: 0 0 0 4px rgba(255, 94, 108, 0.12); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; font-size: 14.5px; font-weight: 600; border-radius: 999px; cursor: pointer; border: none; transition: transform .15s, box-shadow .2s, background .2s; }
.btn-lg { height: 50px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--navy-800); color: white; box-shadow: 0 8px 20px -8px rgba(26, 34, 56, 0.5); }
.btn-primary:hover:not(:disabled) { background: var(--navy-900); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-light { background: white; color: var(--navy-900); border: 1px solid var(--line); }
.btn-light:hover { background: var(--navy-50); }
.btn-ghost { background: transparent; color: var(--navy-700); }
.btn-ghost:hover { background: var(--navy-50); }
.btn-danger { background: #dc2626; color: white; }
.btn-danger:hover { background: #b91c1c; }

.auth-error {
  background: #fef2f2; border: 1px solid #fecaca;
  color: #b91c1c; font-size: 13.5px;
  padding: 10px 12px; border-radius: 8px;
}

.auth-hint {
  margin-top: 20px; padding: 14px 16px;
  background: var(--navy-50); border-radius: 10px;
  font-size: 12.5px; color: var(--navy-500);
}
.hint-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.hint-row span { font-weight: 600; color: var(--navy-700); }
.hint-row code { background: white; padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--coral-600); }
.auth-hint small { display: block; margin-top: 8px; color: var(--navy-500); font-size: 11.5px; }

/* ============================================
   ADMIN PANEL
   ============================================ */
.admin-shell {
  display: grid; grid-template-columns: 260px 1fr; min-height: 100vh;
  background: var(--cream);
}
.admin-side {
  background: var(--navy-900); color: white;
  padding: 24px 18px;
  display: flex; flex-direction: column;
}
.admin-brand { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 18px; }
.admin-brand img { width: 36px; height: auto; background: white; border-radius: 8px; padding: 3px; }
.admin-brand .name { font-family: var(--font-display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.admin-brand .role { font-size: 11px; color: var(--coral-300); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; }

.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  background: transparent; color: rgba(255,255,255,0.7);
  font-family: inherit; font-size: 13.5px; font-weight: 500; text-align: left;
  cursor: pointer; border: none;
  transition: background .2s, color .2s;
}
.admin-nav button:hover { background: rgba(255,255,255,0.06); color: white; }
.admin-nav button.is-active { background: rgba(255, 94, 108, 0.15); color: white; }
.admin-nav button svg { opacity: 0.7; }

.admin-side-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 12.5px; color: rgba(255,255,255,0.5); }
.admin-side-footer a { color: white; display: block; padding: 6px 0; font-size: 13px; }
.admin-side-footer a:hover { text-decoration: none; opacity: 0.85; }
.admin-side-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.admin-side-user .ava-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-brand, var(--coral-500)); display: grid; place-items: center; color: white; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.admin-side-user .info { font-size: 12.5px; }
.admin-side-user .info .email { color: white; font-weight: 600; }
.admin-side-user .info .role { color: var(--coral-300); font-size: 11px; }

.admin-main { padding: 32px 40px; overflow-y: auto; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 28px; margin: 0; letter-spacing: -0.02em; }
.admin-topbar .crumb { color: var(--navy-500); font-size: 13px; margin-bottom: 4px; }

.admin-section-card {
  background: white; border: 1px solid var(--line); border-radius: 16px;
  padding: 28px; margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(15,22,38,0.04);
}
.admin-section-card h2 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; letter-spacing: -0.01em; }
.admin-section-card .help { color: var(--navy-500); font-size: 13px; margin: 0 0 22px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--navy-700); margin-bottom: 6px; }
.field .hint { color: var(--navy-500); font-size: 11.5px; margin-top: 4px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: 14px; color: var(--navy-900);
  background: white; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field select { color: var(--navy-900); appearance: auto; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--coral-500); box-shadow: 0 0 0 4px rgba(255, 94, 108, 0.12); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.list-editor { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.list-item { background: var(--navy-50); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.list-item-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.list-item-head .num { font-size: 12px; font-weight: 700; color: var(--coral-600); }
.list-item .remove { background: none; border: none; color: var(--coral-600); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 8px; }
.list-item .remove:hover { background: rgba(255, 94, 108, 0.1); border-radius: 6px; }
.list-item .field { margin-bottom: 10px; }
.list-item .field:last-child { margin-bottom: 0; }

.list-string-editor { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.list-string-row { display: flex; gap: 6px; }
.list-string-row input { flex: 1; }
.list-string-row .remove { padding: 0 12px; background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--coral-600); cursor: pointer; }
.list-string-row .remove:hover { background: #fef2f2; }

.btn-add {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: var(--coral-50); color: var(--coral-600);
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 1px dashed var(--coral-200); cursor: pointer;
}
.btn-add:hover { background: var(--coral-100); }

.admin-actions {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding-top: 18px; border-top: 1px solid var(--line);
  margin-top: 18px;
}
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--navy-900); color: white;
  padding: 12px 18px; border-radius: 12px;
  font-size: 13.5px; font-weight: 500;
  box-shadow: 0 12px 30px -10px rgba(15, 22, 38, 0.4);
  display: flex; align-items: center; gap: 8px;
  opacity: 0; transform: translateY(20px);
  transition: opacity .25s, transform .25s;
  z-index: 100;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }

.empty { text-align: center; padding: 60px 20px; color: var(--navy-500); }

@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { padding: 16px; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .admin-nav button { padding: 8px 10px; font-size: 12.5px; }
  .admin-main { padding: 20px; }
  .field-row { grid-template-columns: 1fr; }
}
