/* =========================================================================
   BT Cambio Generator — UI styles
   Minimal, ops-tool aesthetic. Brand blue chrome, quiet neutrals so the
   generated arts stand out in the preview grid.
   ========================================================================= */

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-VariableFont_YTLC,opsz,wdth,wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/NunitoSans-Italic-VariableFont_YTLC,opsz,wdth,wght.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: italic;
  font-display: swap;
}

:root {
  --bt-blue:     #044BD9;
  --bt-blue-dk:  #0339a8;
  --bt-blue-tnt: #eef3ff;
  --bt-ink:      #0b1220;
  --bt-ink-mut:  #5b6478;
  --bt-line:     #e3e7ee;
  --bt-line-2:   #c9d1de;
  --bt-bg:       #f4f6fa;
  --bt-surface:  #ffffff;
  --bt-shadow:   0 2px 6px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .06);
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-feature-settings: "ss01", "cv11";
  background: var(--bt-bg);
  color: var(--bt-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.app {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */

.sidebar {
  background: var(--bt-surface);
  border-right: 1px solid var(--bt-line);
  padding: 26px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bt-line);
}
.brand-mark {
  width: 44px; height: 44px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-text { line-height: 1.1; }
.brand-title { font-weight: 900; font-size: 16px; letter-spacing: -.01em; }
.brand-sub   { color: var(--bt-ink-mut); font-size: 12px; margin-top: 2px; }

.section-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bt-ink-mut);
  margin: 4px 0 2px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bt-ink);
}
.field-hint {
  font-size: 11.5px;
  color: var(--bt-ink-mut);
  line-height: 1.45;
}

.control,
input.control,
select.control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--bt-line-2);
  border-radius: var(--r-md);
  padding: 0 12px;
  font: inherit;
  font-size: 14.5px;
  color: var(--bt-ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.control:hover { border-color: #aab4c6; }
.control:focus {
  outline: 0;
  border-color: var(--bt-blue);
  box-shadow: 0 0 0 3px rgba(4, 75, 217, .15);
}
select.control {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235b6478' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Affix input — shows "1 € =" prefix or "%" suffix depending on mode */
.affix-wrap { position: relative; }
.affix-wrap .control { padding-left: 70px; }
.affix-wrap[data-position="right"] .control { padding-left: 12px; padding-right: 40px; }
.affix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 800;
  color: var(--bt-ink-mut);
  letter-spacing: .02em;
  pointer-events: none;
}
.affix-wrap[data-position="left"]  .affix { left: 14px; }
.affix-wrap[data-position="right"] .affix { right: 14px; }

/* Segmented control for campaign type */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f0f3f8;
  border: 1px solid var(--bt-line);
  border-radius: var(--r-md);
  padding: 4px;
  gap: 4px;
}
.segmented input { display: none; }
.segmented label {
  display: grid;
  place-items: center;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bt-ink-mut);
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.segmented input:checked + label {
  background: #fff;
  color: var(--bt-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 0 0 1px rgba(15, 23, 42, .04);
}

/* Buttons */
.btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: var(--r-md);
  font: inherit;
  font-weight: 800;
  font-size: 14.5px;
  letter-spacing: .01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .06s, background .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--bt-blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(4, 75, 217, .25);
}
.btn-primary:hover { background: var(--bt-blue-dk); }
.btn-primary:disabled { background: #94a4c4; cursor: progress; box-shadow: none; }
.btn-ghost {
  background: #fff;
  color: var(--bt-ink);
  border: 1px solid var(--bt-line-2);
}
.btn-ghost:hover { background: #f6f8fc; }

.button-row { display: grid; gap: 10px; margin-top: 4px; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--bt-line);
  font-size: 11.5px;
  color: var(--bt-ink-mut);
  line-height: 1.5;
}
.sidebar-foot kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  background: #eef1f6;
  border: 1px solid var(--bt-line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 5px;
}

/* ── Main / preview grid ────────────────────────────────────────────────── */

.main { padding: 26px 32px 40px; overflow: auto; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.top h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.01em;
}
.top-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--bt-ink-mut);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bt-blue-tnt);
  color: var(--bt-blue);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 999px;
}
.pill::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bt-blue);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 22px;
}

.card {
  background: var(--bt-surface);
  border: 1px solid var(--bt-line);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--bt-shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 0;
}
.card-title {
  font-weight: 900;
  font-size: 14.5px;
  letter-spacing: -.005em;
}
.card-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--bt-ink-mut);
  margin-top: 2px;
  letter-spacing: .02em;
}
.card-dl {
  border: 1px solid var(--bt-line-2);
  background: #fff;
  color: var(--bt-ink);
  font: inherit;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: .04em;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .15s, color .15s, border-color .15s;
}
.card-dl:hover {
  background: var(--bt-blue);
  border-color: var(--bt-blue);
  color: #fff;
}

.preview {
  background: #e7ecf3;
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  margin: 0 auto;
  width: 100%;
}
.preview svg { width: 100%; height: auto; display: block; }
.preview svg text,
.preview svg tspan { font-family: "Nunito Sans", Arial, sans-serif !important; }

.post  { max-width: 100%; }
.story { max-width: 76%; }

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--bt-line);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .main { padding: 22px; }
  .story { max-width: 100%; }
}
