:root {
  --navy: #0B2B5B;
  --gold: #F5B71C;
  --gold-soft: #ffd360;
  --ink: #0B2B5B;
  --body: #3a4a66;
  --muted: #6b7990;
  --bg: #f1f4f9;
  --tile: #eaf2fb;
  --line: #d6dfeb;
  --white: #ffffff;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--body);
  min-height: 100vh;
}
h1, h2, h3 { font-family: 'Bitter', Georgia, serif; color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: #b3261e; font-weight: 600; }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }

/* brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 22px; margin: 0; font-weight: 900; letter-spacing: 0.2px; }
.brand h1 em { color: var(--gold); font-style: normal; font-weight: 700; }
.brand-mark {
  width: 14px; height: 36px; border-radius: 4px;
  background: linear-gradient(180deg, var(--gold) 0 45%, var(--navy) 45% 100%);
  display: inline-block;
}

/* gate */
.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.gate-card { background: var(--white); border-radius: var(--radius); padding: 36px 40px; width: min(420px, 92vw); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.gate-card form { display: flex; gap: 10px; margin-top: 14px; }
.gate-card input { flex: 1; }

/* layout */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(16px, 5vw, 48px);
  background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; backdrop-filter: blur(8px);
}
main { max-width: 880px; margin: 28px auto 80px; padding: 0 16px; }
footer { text-align: center; padding: 24px; font-size: 12px; }

.steps { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.steps li {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  counter-increment: step;
}
.steps li.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.steps li.done { background: var(--tile); color: var(--navy); }

.panel {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px); margin-bottom: 20px;
  box-shadow: 0 8px 30px rgba(11,43,91,.06);
}
.panel h2 { margin-top: 0; font-size: 24px; }

/* form */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--ink); font-size: 14px; }
.grid .span2 { grid-column: span 2; }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } .grid .span2 { grid-column: span 1; } }
input, textarea, select {
  font: inherit; color: var(--body);
  padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--white);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(11,43,91,.12); }
.check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 500 !important; line-height: 1.5; }
.check input { margin-top: 3px; }

/* buttons */
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 10px;
  padding: 12px 22px; border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(11,43,91,.18); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.status { font-size: 13px; color: var(--muted); }

/* preview */
.preview-head { display: flex; align-items: center; gap: 12px; }
.pill { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; background: var(--tile); color: var(--navy); padding: 4px 10px; border-radius: 999px; }
.subject-line { margin: 10px 0 16px; font-size: 15px; }
.subject-line span[contenteditable] { border-bottom: 1.5px dashed var(--gold); padding: 1px 3px; }
.email-frame {
  background: #9AB0DE; border-radius: var(--radius); padding: clamp(12px, 4vw, 32px);
  border: 1px solid var(--line);
}
#email-preview {
  max-width: 600px; margin: 0 auto; background: var(--white); border-radius: 4px; overflow: hidden;
  font-family: 'Inter', Helvetica, Arial, sans-serif;
}
#email-preview .ep-pad { padding: 8px 20px; }
#email-preview h1 { font-size: 28px; font-weight: 900; text-align: center; margin: 18px 14px 6px; }
#email-preview .gold-rule { width: 18%; height: 3px; background: var(--gold); margin: 8px auto 12px; border: 0; }
#email-preview p { font-size: 15px; line-height: 1.6; margin: 8px 0; }
#email-preview .section { background: var(--tile); border-radius: 8px; margin: 10px 14px; padding: 10px 4px; }
#email-preview .section h2 { font-size: 19px; text-align: left; margin: 6px 20px 2px; }
#email-preview .cta { text-align: center; padding: 18px 0; }
#email-preview .cta a {
  background: var(--gold); color: var(--navy); font-weight: 700; text-decoration: none;
  padding: 12px 32px; border-radius: 8px; display: inline-block;
}
#email-preview .footer { border-top: 1px solid var(--line); margin-top: 12px; padding: 10px 20px 18px; text-align: center; font-size: 12px; color: var(--muted); }
#email-preview img.logo { display: block; margin: 18px auto 10px; width: 53%; }

/* result */
.screenshot { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; margin-top: 14px; }
