/* ── Signature Studio — Stripe-inspired theme ─────────────────────── */

:root {
  --blurple: #635bff;
  --blurple-dark: #5851ea;
  --navy: #0a2540;
  --slate: #425466;
  --slate-light: #697386;
  --bg: #f6f9fc;
  --border: #e6ebf1;
  --card-shadow: 0 6px 12px -2px rgba(50, 50, 93, 0.12), 0 3px 7px -3px rgba(0, 0, 0, 0.15);
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--slate);
  -webkit-font-smoothing: antialiased;
}

/* ── Hero with slanted Stripe gradient ────────────────────────────── */

.hero { position: relative; overflow: hidden; padding-bottom: 24px; }

.hero-gradient {
  position: absolute;
  inset: -40% -10% 4% -10%;
  transform: skewY(-6deg);
  transform-origin: top left;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255, 203, 87, 0.55), transparent 50%),
    radial-gradient(ellipse at 85% 15%, rgba(0, 212, 255, 0.5), transparent 55%),
    radial-gradient(ellipse at 65% 85%, rgba(169, 96, 238, 0.55), transparent 55%),
    linear-gradient(120deg, #635bff 0%, #7a73ff 45%, #4f8dff 100%);
}

.hero-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 32px 84px;
}

.nav { display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blurple);
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 2px 6px rgba(10, 37, 64, 0.25);
}

.brand-name { color: #fff; font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }

.hero-copy { margin-top: 46px; max-width: 640px; }

.hero-copy h1 {
  color: #fff;
  font-size: 44px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.6px;
  text-shadow: 0 2px 14px rgba(10, 37, 64, 0.18);
}

.hero-copy p {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.55;
  max-width: 540px;
}

/* ── Layout ───────────────────────────────────────────────────────── */

.container {
  max-width: 1180px;
  margin: -34px auto 0;
  padding: 0 32px 40px;
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 28px;
  align-items: start;
  position: relative;
  z-index: 2;
}

@media (max-width: 980px) {
  .container { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 28px;
}

.card-title { color: var(--navy); font-size: 19px; font-weight: 700; letter-spacing: -0.2px; }

.card-sub { margin: 6px 0 22px; font-size: 13.5px; color: var(--slate-light); }

.req { color: var(--blurple); font-weight: 700; }

.label-note { font-weight: 400; color: var(--slate-light); font-size: 11.5px; }

/* ── Form ─────────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; display: flex; flex-direction: column; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}

.field input,
.field textarea,
.type-row select,
.type-row input {
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--navy);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fff;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: #a3acb9; }

.field input:focus,
.field textarea:focus,
.type-row select:focus,
.type-row input:focus {
  border-color: var(--blurple);
  box-shadow: 0 0 0 4px rgba(99, 91, 255, 0.18);
}

.hint { margin-top: 5px; font-size: 12px; color: var(--slate-light); }

.section-label {
  margin: 22px 0 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--slate-light);
}

/* Upload rows */

.upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.btn-upload {
  background: #eef2f7;
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
}

.btn-upload:hover { background: #e2e8f0; }

.upload-clear {
  border: 0;
  background: transparent;
  color: var(--slate-light);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.upload-clear:hover { color: #cd3d64; background: #fdf2f6; }

.upload-thumb {
  height: 34px;
  max-width: 90px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 2px;
}

.upload-name {
  font-size: 12px;
  color: var(--slate-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 150px;
}

/* Typography controls */

.type-row { display: grid; grid-template-columns: 1fr 110px; gap: 14px; }

.type-row > div { display: flex; flex-direction: column; }

.mini-label { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }

/* Template pills */

.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  transition: all .15s ease;
}

.pill:hover { border-color: #c9d2de; transform: translateY(-1px); }

.pill.active {
  background: var(--blurple);
  border-color: var(--blurple);
  color: #fff;
  box-shadow: 0 3px 8px rgba(99, 91, 255, 0.35);
}

/* Colour swatches */

.swatch-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.swatch {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border), 0 2px 5px rgba(50, 50, 93, 0.15);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  padding: 0;
}

.swatch:hover { transform: scale(1.12); }

.swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blurple);
  transform: scale(1.08);
}

.swatch-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#ff5f6d, #ffc371, #a8e063, #00c9ff, #b06ab3, #ff5f6d);
  position: relative;
  overflow: hidden;
}

.swatch-custom input[type="color"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%; height: 100%;
}

/* ── Preview column ───────────────────────────────────────────────── */

.preview-col { position: sticky; top: 20px; }

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.tabs {
  display: inline-flex;
  background: #eef2f7;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.tab {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--slate);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all .15s ease;
}

.tab.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(50, 50, 93, 0.18); }

/* Fake mail window */

.preview-stage {
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  background: #fff;
}

.mail-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(#fafbfd, #f1f4f9);
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }

.mail-title { margin-left: 10px; font-size: 12px; font-weight: 600; color: var(--slate-light); }

.mail-body { padding: 20px 22px 26px; overflow-x: auto; }

.mail-fake-line { font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.mail-fake-line.dim { color: #a3acb9; margin-bottom: 22px; }

.signature-mount { animation: fadeIn .25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Code view */

.code-stage {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0a2540;
  color: #d3e0ee;
  padding: 18px;
  font: 12px/1.6 "Cascadia Code", Consolas, monospace;
  max-height: 460px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Action buttons */

.actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.btn {
  font-family: var(--font);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 10px 20px;
  cursor: pointer;
  border: 0;
  transition: all .15s ease;
}

.btn-primary {
  background: var(--blurple);
  color: #fff;
  box-shadow: 0 4px 10px rgba(99, 91, 255, 0.38);
}

.btn-primary:hover {
  background: var(--blurple-dark);
  transform: translateY(-1px);
  box-shadow: 0 7px 16px rgba(99, 91, 255, 0.45);
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  box-shadow: 0 0 0 1px var(--border), 0 2px 5px rgba(50, 50, 93, 0.1);
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px #c9d2de, 0 4px 9px rgba(50, 50, 93, 0.14);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }

.btn:active { transform: translateY(0); }

.actions-hint { margin-top: 14px; font-size: 12.5px; color: var(--slate-light); line-height: 1.5; }

/* ── Footer & toast ───────────────────────────────────────────────── */

.footer {
  text-align: center;
  font-size: 12.5px;
  color: var(--slate-light);
  padding: 8px 20px 26px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 80px);
  background: var(--navy);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(10, 37, 64, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.2, .9, .3, 1.2);
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #cd3d64; }
