/* Palette pulled from the 34 Day Relationship Reboot header art */
:root {
  --navy-900: #081a2a;
  --navy-800: #0c2438;
  --navy-700: #12324a;
  --teal-600: #1b5566;
  --teal-400: #2f7a86;
  --gold-500: #d4a24c;
  --gold-300: #ecc97c;
  --gold-100: #f8e7bf;
  --cream:    #f6ecd8;
  --text:     #efe6d2;
  --muted:    #b9b2a0;
  --danger:   #e7826f;
  --radius:   14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212,162,76,.18), transparent 60%),
    linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  background-color: var(--navy-900);
  color: var(--text);
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
}

a { color: var(--gold-300); }

/* ---------- Public page ---------- */
.hero { width: 100%; max-width: 1400px; margin: 0 auto; }
.hero img { display: block; width: 100%; height: auto; }

.main {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 16px 64px;
  text-align: center;
}

.divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--gold-500); margin: 0 auto 28px; max-width: 420px;
}
.divider::before, .divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
}

.explanation { color: var(--text); margin-bottom: 36px; }
.explanation p { margin: 0 0 1em; }

.card {
  background: linear-gradient(180deg, rgba(27,85,102,.35), rgba(12,36,56,.6));
  border: 1px solid rgba(212,162,76,.45);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.35), inset 0 1px 0 rgba(236,201,124,.15);
}

.code-label {
  display: block;
  font-family: "Cinzel", Georgia, serif;
  font-size: 15px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 14px;
}

.code-form { display: flex; flex-direction: column; gap: 16px; align-items: stretch; max-width: 420px; margin: 0 auto; }

.code-input {
  width: 100%;
  padding: 16px 18px;
  font: 600 22px/1.2 "Cinzel", Georgia, serif;
  letter-spacing: .18em; text-align: center; text-transform: uppercase;
  color: var(--cream);
  background: rgba(8,26,42,.75);
  border: 1px solid rgba(212,162,76,.55);
  border-radius: 10px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.code-input::placeholder { color: rgba(239,230,210,.35); letter-spacing: .1em; }
.code-input:focus { border-color: var(--gold-300); box-shadow: 0 0 0 4px rgba(212,162,76,.2); }

.btn-gold {
  display: inline-block;
  padding: 15px 28px;
  font: 700 16px/1 "Cinzel", Georgia, serif;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--navy-900);
  background: linear-gradient(180deg, var(--gold-300) 0%, var(--gold-500) 100%);
  border: 0; border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(212,162,76,.3);
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn-gold:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(212,162,76,.42); }
.btn-gold:active { transform: translateY(1px); }

.error {
  color: var(--danger);
  background: rgba(231,130,111,.1);
  border: 1px solid rgba(231,130,111,.35);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 16px;
}

.footer { text-align: center; color: var(--muted); font-size: 14px; padding: 0 16px 32px; }

/* ---------- Admin ---------- */
.admin-wrap { max-width: 900px; margin: 0 auto; padding: 32px 16px 80px; }
.admin-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-top h1 { font-family: "Cinzel", Georgia, serif; color: var(--gold-300); font-size: 26px; margin: 0; letter-spacing: .06em; }
.admin-top .links { display: flex; gap: 16px; font-size: 15px; }

.panel {
  background: rgba(18,50,74,.55);
  border: 1px solid rgba(212,162,76,.3);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.panel h2 {
  font-family: "Cinzel", Georgia, serif; font-size: 18px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-300); margin: 0 0 6px;
}
.panel .hint { color: var(--muted); font-size: 15px; margin: 0 0 18px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 15px; font-weight: 600; color: var(--gold-100); margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }

.input, textarea.input {
  width: 100%;
  padding: 11px 13px;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--cream);
  background: rgba(8,26,42,.8);
  border: 1px solid rgba(212,162,76,.35);
  border-radius: 8px;
  outline: none;
}
.input:focus { border-color: var(--gold-300); box-shadow: 0 0 0 3px rgba(212,162,76,.18); }
textarea.input { min-height: 160px; resize: vertical; }

.header-preview { width: 100%; border-radius: 10px; border: 1px solid rgba(212,162,76,.3); display: block; margin-bottom: 12px; }

.codes-table { width: 100%; border-collapse: collapse; }
.codes-table th { text-align: left; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 6px 8px; font-weight: 600; }
.codes-table td { padding: 5px 6px; vertical-align: middle; }
.codes-table td:first-child { width: 22%; }
.codes-table td:nth-child(3) { width: 22%; }
.codes-table td:last-child { width: 44px; }
.codes-table .input { padding: 9px 10px; font-size: 15px; }
.codes-table .code-cell { text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.btn-ghost {
  padding: 9px 14px; font: 600 14px/1 system-ui, sans-serif;
  color: var(--gold-300); background: transparent;
  border: 1px solid rgba(212,162,76,.5); border-radius: 8px; cursor: pointer;
}
.btn-ghost:hover { background: rgba(212,162,76,.1); }
.btn-remove {
  width: 34px; height: 34px; font-size: 20px; line-height: 1;
  color: var(--danger); background: transparent;
  border: 1px solid rgba(231,130,111,.4); border-radius: 8px; cursor: pointer;
}
.btn-remove:hover { background: rgba(231,130,111,.12); }

.save-bar {
  position: sticky; bottom: 0;
  display: flex; justify-content: flex-end; gap: 12px; align-items: center;
  padding: 14px 0;
  background: linear-gradient(180deg, transparent, var(--navy-900) 35%);
}

.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 16px; }
.notice.ok { background: rgba(47,122,134,.25); border: 1px solid rgba(47,122,134,.6); color: #cdeef0; }
.notice.err { background: rgba(231,130,111,.12); border: 1px solid rgba(231,130,111,.45); color: var(--danger); }

.login-box { max-width: 420px; margin: 10vh auto 0; padding: 0 16px; }
.login-box h1 { font-family: "Cinzel", Georgia, serif; color: var(--gold-300); text-align: center; letter-spacing: .08em; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .main { padding-top: 28px; }
  .card { padding: 24px 16px; }
  .panel { padding: 18px 14px; }
  .codes-table thead { display: none; }
  .codes-table, .codes-table tbody, .codes-table tr, .codes-table td { display: block; width: 100% !important; }
  .codes-table tr { position: relative; padding: 10px 44px 10px 0; border-bottom: 1px solid rgba(212,162,76,.2); }
  .codes-table td { padding: 3px 0; }
  .codes-table td:last-child { position: absolute; top: 12px; right: 0; width: auto !important; }
}
