/* Taste of Puebla — Internal Portal
   Brand palette: warm cream, terracotta, cocoa, golden, sage */

:root {
  --cream: #FAF6F0;
  --cream-2: #F2EADF;
  --green: #3F6B47;
  --green-dark: #2D5034;
  --green-deep: #1F3D26;
  --cocoa: #3D2914;
  --golden: #E8A33E;
  --terracotta: #B85339;
  --ink: #2A2218;
  --muted: #6B5B4A;
  --line: #E5D9C7;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .serif {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }

/* ——— Login screen ——— */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 880px) { .login-shell { grid-template-columns: 1fr; } }

.login-hero {
  background:
    linear-gradient(135deg, rgba(31,61,38,0.82), rgba(63,107,71,0.7)),
    radial-gradient(circle at 30% 20%, #E8A33E 0%, transparent 55%),
    #1F3D26;
  color: var(--cream);
  padding: 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 80% 80%, rgba(232,163,62,0.20) 0%, transparent 35%),
    radial-gradient(circle at 10% 90%, rgba(184,83,57,0.14) 0%, transparent 40%);
  pointer-events: none;
}
.login-hero > * { position: relative; z-index: 1; }
.brand-mark {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}
.brand-mark span { color: var(--golden); }
.brand-logo { height: 30px; width: auto; display: block; }
.topbar .brand-logo { height: 26px; }
.hero-headline {
  font-size: 44px;
  line-height: 1.1;
  margin: 0 0 16px;
  color: var(--cream);
}
.hero-tag {
  font-style: italic;
  font-family: 'Fraunces', serif;
  font-size: 18px;
  opacity: 0.92;
  margin: 0 0 32px;
}
.hero-foot {
  font-size: 13px;
  opacity: 0.7;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 56px;
}
.login-card {
  width: 100%;
  max-width: 380px;
}
.login-card h2 {
  font-size: 30px;
  margin: 0 0 8px;
}
.login-card .subtitle {
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 15px;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(63,107,71,0.15);
}
.btn-primary {
  width: 100%;
  padding: 13px 16px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  margin-top: 8px;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.error-msg {
  background: #fdf1ee;
  color: #9A3F28;
  border: 1px solid #f4d4cc;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.error-msg.show { display: block; }
.turnstile-wrap { margin: 6px 0 14px; min-height: 0; }
.turnstile-wrap:empty { margin: 0; }

/* ——— Portal dashboard ——— */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .brand-mark { color: var(--cocoa); }
.topbar .brand-mark span { color: var(--green); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 10px;
  border-radius: 6px;
}
.btn-link:hover { background: var(--cream-2); color: var(--ink); }

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}
.page-header h1 {
  font-size: 40px;
  margin: 0 0 8px;
}
.page-header p {
  color: var(--muted);
  font-size: 17px;
  margin: 0 0 48px;
  max-width: 580px;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.agent-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px 24px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  position: relative;
  min-height: 200px;
}
.agent-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(31,61,38,0.10);
  border-color: rgba(63,107,71,0.4);
}
.agent-card.soon {
  opacity: 0.7;
  cursor: not-allowed;
}
.agent-card.soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--line);
}
.agent-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--green), var(--golden));
  color: #fff;
}
.agent-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
  color: var(--ink);
}
.agent-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
  flex-grow: 1;
}
.agent-card .card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}
.agent-card .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--cream-2);
  color: var(--muted);
}
.agent-card .last-visit {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.agent-card.live .badge { background: rgba(63,107,71,0.15); color: var(--green-dark); }

/* ——— Backup & restore panel ——— */
.backup-panel {
  margin-top: 56px;
  padding: 24px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.backup-text { flex: 1 1 320px; min-width: 0; }
.backup-text h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--ink);
}
.backup-text p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.backup-meta {
  margin-top: 6px !important;
  font-size: 12px !important;
  color: var(--muted);
  font-style: italic;
}
.backup-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.backup-btn { width: auto; padding: 11px 18px; font-size: 14px; margin-top: 0; }

/* ——— Modal ——— */
.modal-shroud {
  position: fixed;
  inset: 0;
  background: rgba(31,61,38,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5000;
  padding: 24px;
}
.modal-shroud[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(31,61,38,0.25);
}
.modal-card h3 { margin: 0 0 12px; font-size: 22px; }
.modal-card p { color: var(--muted); margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.modal-warn { color: var(--cocoa) !important; background: #fef6e7; border: 1px solid #f4e1ba; padding: 10px 12px; border-radius: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-actions .btn-primary,
.modal-actions .btn-ghost { width: auto; padding: 10px 18px; font-size: 14px; margin-top: 0; }

/* ——— Coming soon page ——— */
.soon-wrap {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
}
.soon-card { max-width: 480px; }
.soon-card h1 { font-size: 36px; margin: 0 0 12px; }
.soon-card p { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0 0 28px; }
.btn-ghost {
  display: inline-block;
  padding: 11px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  background: #fff;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }
