/* =========================================================
 * Configurator — public layout styles
 * Mobile-first, brand color exposed as --brand
 * ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fb;
  color: #1a2333;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- LAYOUT ---------- */

.cfg-header {
  background: var(--brand);
  color: #fff;
  padding: 1rem 1rem;
}
.cfg-header .cfg-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cfg-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.cfg-header .cfg-brand-logo {
  height: 36px; width: auto; background: #fff; padding: 4px; border-radius: 4px;
}
.cfg-header .cfg-lang {
  font-size: .8rem;
  opacity: .85;
}

.cfg-main {
  max-width: 1100px;
  margin: 1.5rem auto;
  padding: 0 1rem 4rem;
}

.cfg-footer {
  border-top: 1px solid #e6ebf3;
  background: #fff;
  padding: 1.25rem 1rem;
  color: #6b7a90;
  font-size: .85rem;
}
.cfg-footer .cfg-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
}
.cfg-footer pre.note {
  margin: 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: inherit;
}

/* ---------- COMPONENTS ---------- */

.cfg-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(20, 35, 60, 0.06);
  padding: 1.25rem;
}
.cfg-card + .cfg-card { margin-top: 1rem; }

.cfg-card h2 {
  margin: 0 0 .75rem;
  font-size: 1rem;
  color: var(--brand);
  border-bottom: 1px solid #eef2f8;
  padding-bottom: .5rem;
}

.cfg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 720px) {
  .cfg-grid--2 { grid-template-columns: repeat(2, 1fr); }
  .cfg-grid--auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
}

.cfg-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .75rem;
  font-weight: 600;
}
.cfg-badge--on  { background: #d4edda; color: #155724; }
.cfg-badge--off { background: #e2e3e5; color: #6c757d; }

.cfg-btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: .65rem 1.1rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: filter .15s;
}
.cfg-btn:hover { filter: brightness(.92); }
.cfg-btn:disabled { opacity: .5; cursor: not-allowed; }
.cfg-btn--ghost {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.cfg-input,
.cfg-select,
.cfg-textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  font: inherit;
  background: #fff;
}
.cfg-input:focus,
.cfg-select:focus,
.cfg-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 142, 241, 0.15);
}
.cfg-label {
  display: block;
  font-size: .8rem;
  color: #6b7a90;
  margin-bottom: .25rem;
  font-weight: 500;
}
.cfg-field { margin-bottom: 1rem; }

/* Definition list helper used by demo */
.cfg-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 40% 60%;
  row-gap: .35rem;
  font-size: .9rem;
}
.cfg-dl dt { color: #6b7a90; font-weight: 500; }
.cfg-dl dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.cfg-dl dd.empty { color: #c3ccd9; font-style: italic; }

/* Meta debug box — visible only in DEV */
.cfg-meta {
  background: #1a2333;
  color: #b6c0d3;
  padding: .85rem 1rem;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  margin-bottom: 1rem;
  display: grid;
  gap: .15rem;
}
.cfg-meta strong { color: #fff; }

/* =========================================================
 * MVP Wizard
 * ========================================================= */

.cfg-steps {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.cfg-step {
  flex: 1 1 0;
  min-width: 110px;
  background: #fff;
  border: 1px solid #d8dee8;
  color: #6b7a90;
  border-radius: 6px;
  padding: .55rem .75rem;
  font-size: .85rem;
  text-align: center;
  font-weight: 500;
}
.cfg-step--done    { border-color: #b6d7c1; color: #155724; }
.cfg-step--current { border-color: var(--brand); color: var(--brand); background: rgba(31,142,241,.05); }

.cfg-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.cfg-tile {
  border: 2px solid #e1e6ee;
  border-radius: 8px;
  padding: .85rem;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color .12s, transform .12s;
}
.cfg-tile:hover { border-color: var(--brand); }
.cfg-tile.is-active { border-color: var(--brand); background: rgba(31,142,241,.06); }
.cfg-tile small { display: block; color: #6b7a90; font-size: .75rem; margin-top: .15rem; }

.cfg-swatch {
  display: inline-block;
  width: 100%;
  height: 36px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.08);
  margin-bottom: .35rem;
}

.cfg-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: .5rem;
  align-items: end;
  padding: .75rem;
  border: 1px solid #eef2f8;
  border-radius: 6px;
  margin-bottom: .5rem;
  background: #fafbfd;
}
@media (min-width: 720px) {
  .cfg-row {
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
  }
}
.cfg-row .cfg-label { margin-bottom: .15rem; }

.cfg-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  justify-content: space-between;
}
.cfg-actions .left, .cfg-actions .right { display: flex; gap: .5rem; flex-wrap: wrap; }

.cfg-alert {
  padding: .75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  background: #fff8e1;
  border-left: 4px solid #ffb300;
}
.cfg-alert--error   { background: #fdecea; border-left-color: #d93025; color: #5e1a14; }
.cfg-alert--success { background: #e6f4ea; border-left-color: #1e8e3e; color: #14532d; }

.cfg-icon-btn {
  background: none;
  border: 0;
  color: #c0392b;
  cursor: pointer;
  font-size: 1rem;
  padding: .35rem .5rem;
}

[v-cloak] { display: none !important; }
