/* WearsCO. Forms — palette and type match wearsco.sk */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --cream: #F1DAC4;
  --lilac: #A69CAC;
  --grape: #474973;
  --prussian: #161B33;
  --ink: #0D0C1D;
  --bg: #faf6f1;
  --card: #ffffff;
  --text: #2e2848;
  --muted: #7a7590;
  --line: #ebe3da;
  --danger: #b4334a;
  --success: #2f7a5a;
  --warn: #9a6a1c;
  --r-pill: 100px;
  --r-card: 22px;
  --r-input: 12px;
  --shadow-sm: 0 2px 14px rgba(71,73,115,0.07);
  --shadow-md: 0 8px 30px rgba(71,73,115,0.12);
  --t: .2s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; }
body {
  margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text);
  line-height: 1.55; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--grape); color: var(--cream); }
a { color: var(--grape); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; color: var(--prussian); margin: 0 0 .5em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
.serif, h1 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; }
hr { border: 0; border-top: 1px solid var(--line); margin: .5rem 0; width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.strong { font-weight: 600; text-decoration: none; color: var(--prussian); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.danger { color: var(--danger); }

/* ── Logo ── */
.logo { font-family: 'DM Serif Display', Georgia, serif; font-size: 1.5rem; color: var(--cream); text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--lilac); }
.logo small { font-family: 'Inter', sans-serif; font-size: .75rem; color: var(--lilac); letter-spacing: .08em; text-transform: uppercase; margin-left: .35rem; }
.logo.big { font-size: 2.4rem; color: var(--prussian); }
.logo.big span { color: var(--grape); }

/* ── Form controls ── */
label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; font-weight: 500; color: var(--text); }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; font: inherit; font-weight: 400; font-size: .95rem; color: var(--text);
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-input); padding: .65rem .85rem;
  transition: border-color var(--t), box-shadow var(--t);
}
textarea { resize: vertical; min-height: 5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 4px rgba(71,73,115,.12); }
input:disabled { background: var(--bg); color: var(--muted); }
input[type=checkbox], input[type=radio] { accent-color: var(--grape); width: 1.1rem; height: 1.1rem; margin: 0; flex: none; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 400; margin-top: 1rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1; text-decoration: none; white-space: nowrap;
  padding: .8rem 1.35rem; border-radius: var(--r-pill); border: 1.5px solid transparent; cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grape); color: var(--cream); }
.btn-primary:hover { background: var(--prussian); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--grape); border-color: rgba(71,73,115,.25); }
.btn-ghost:hover { border-color: var(--grape); background: rgba(71,73,115,.05); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(180,51,74,.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: .5rem .95rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--grape); cursor: pointer; text-decoration: underline; }

/* ── Admin shell ── */
.topbar {
  display: flex; align-items: center; gap: 2rem; padding: .9rem 2rem; background: var(--prussian);
  position: sticky; top: 0; z-index: 20;
}
.topbar nav { display: flex; gap: .25rem; flex: 1; }
.topbar nav a { color: var(--lilac); text-decoration: none; font-weight: 500; font-size: .92rem; padding: .45rem .9rem; border-radius: var(--r-pill); }
.topbar nav a:hover { color: var(--cream); }
.topbar nav a.active { color: var(--prussian); background: var(--cream); }
.topbar-user { display: flex; align-items: center; gap: 1rem; font-size: .88rem; }
.topbar-user a { color: var(--cream); text-decoration: none; }
.topbar-user button.link { color: var(--lilac); }
.container { max-width: 1180px; margin: 0 auto; padding: 2rem; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
body.bare { background: var(--prussian); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.sticky-head { position: sticky; top: 62px; z-index: 10; background: var(--bg); padding: 1rem 0; margin: -1rem 0 0; border-bottom: 1px solid var(--line); }
.back { display: inline-block; font-size: .85rem; text-decoration: none; color: var(--muted); margin-bottom: .35rem; }
.back:hover { color: var(--grape); }
.meta { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; font-size: .9rem; }
.actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }

.card { background: var(--card); border-radius: var(--r-card); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card.empty { text-align: center; padding: 3rem 1.5rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack > form { margin: 0; }
.narrow { max-width: 520px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.25rem; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline-form input { min-width: 0; }

.flash { padding: .85rem 1.1rem; border-radius: 14px; margin-bottom: 1rem; font-size: .92rem; background: #fff; border-left: 4px solid var(--grape); box-shadow: var(--shadow-sm); }
.flash-success { border-color: var(--success); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.notice { background: #fbf3e6; border-radius: 12px; padding: .75rem 1rem; font-size: .9rem; color: var(--warn); margin: 0 0 1rem; }

/* Login */
.login-card { background: #fff; border-radius: var(--r-card); padding: 2.5rem; width: 100%; max-width: 400px; box-shadow: var(--shadow-md); text-align: center; }
.login-card form { text-align: left; margin-top: 1.5rem; }
.login-card .logo.big { margin-bottom: .25rem; display: block; }

/* Dashboard */
.filters { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { padding: .45rem .9rem; border-radius: var(--r-pill); background: #fff; text-decoration: none; color: var(--text); font-size: .85rem; font-weight: 500; box-shadow: var(--shadow-sm); }
.chip span { color: var(--muted); margin-left: .2rem; }
.chip.active { background: var(--grape); color: var(--cream); }
.chip.active span { color: var(--lilac); }
.search input { min-width: 260px; border-radius: var(--r-pill); }
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 1rem 1.1rem .7rem; border-bottom: 1px solid var(--line); }
.table td { padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #fcfaf7; }
.table tr.inactive { opacity: .55; }

.badge { display: inline-block; padding: .25rem .65rem; border-radius: var(--r-pill); font-size: .75rem; font-weight: 600; background: #efebf3; color: var(--muted); white-space: nowrap; }
.badge-opened { background: #e9e8f5; color: var(--grape); }
.badge-in_progress { background: #fbf0dd; color: var(--warn); }
.badge-submitted { background: #e1f1e9; color: var(--success); }

/* New form */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.template-option { flex-direction: row; align-items: flex-start; gap: .7rem; padding: 1rem; border: 1.5px solid var(--line); border-radius: 16px; cursor: pointer; transition: border-color var(--t), background var(--t); }
.template-option:hover { border-color: var(--lilac); }
.template-option:has(input:checked) { border-color: var(--grape); background: #f6f4fa; }
.template-option input { margin-top: .15rem; }
.template-option span { display: flex; flex-direction: column; gap: .2rem; }
.template-option small { font-weight: 400; color: var(--muted); }

/* Form detail */
.link-card .label { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .5rem; }
.link-row { display: flex; gap: .5rem; align-items: center; flex-direction: row; }
.link-row input { font-family: ui-monospace, Consolas, monospace; font-size: .85rem !important; }
.link-card .muted { margin-top: .6rem; }
.answers-section { margin-bottom: 1.5rem; }
.answers-title { font-size: 1rem; color: var(--grape); padding-bottom: .4rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; }
.answer { display: grid; grid-template-columns: 38% 1fr; gap: 1rem; padding: .55rem 0; font-size: .93rem; }
.answer-q { color: var(--muted); }
.answer.is-empty .answer-a { color: #c1bacb; }
.file-line { margin-bottom: .2rem; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.timeline li { padding: .4rem 0 .4rem 1.1rem; position: relative; }
.timeline li::before { content: ''; position: absolute; left: 0; top: .85rem; width: 7px; height: 7px; border-radius: 50%; background: var(--grape); }
.timeline li.pending { color: var(--muted); }
.timeline li.pending::before { background: var(--line); }
.timeline span { display: block; font-weight: 600; color: var(--prussian); }
.timeline li.pending span { color: var(--muted); font-weight: 500; }
.note { border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .75rem; font-size: .9rem; }
.note-head { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .25rem; }
.note-head form { margin-left: auto; }

/* Templates */
.template-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.template-card { display: flex; flex-direction: column; justify-content: space-between; gap: 1rem; }
.template-card p { margin: .2rem 0; }

/* Team */
details.menu { position: relative; display: inline-block; text-align: left; }
details.menu summary { list-style: none; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-body { position: absolute; right: 0; top: calc(100% + .4rem); background: #fff; border-radius: 16px; box-shadow: var(--shadow-md); padding: 1rem; width: 250px; z-index: 5; }

/* ── Builder ── */
.builder-legend { margin: .25rem 0 -.25rem; }
.b-section { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-sm); margin-bottom: 1rem; overflow: hidden; }
.b-section-head { background: var(--prussian); color: var(--cream); padding: 1rem 1.25rem; display: grid; grid-template-columns: 1fr auto; gap: .75rem; align-items: start; }
.b-section-head .pair input, .b-section-head .pair textarea { background: rgba(255,255,255,.07); border-color: rgba(241,218,196,.15); color: var(--cream); }
.b-section-head .pair input::placeholder, .b-section-head .pair textarea::placeholder { color: rgba(166,156,172,.7); }
.b-section-head .pair input:first-child { font-weight: 600; }
.b-section-body { padding: 1rem 1.25rem 1.25rem; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.pair + .pair { margin-top: .5rem; }
.pair > div { position: relative; }
.pair > div::before { content: attr(data-lang); position: absolute; right: .6rem; top: .55rem; font-size: .65rem; font-weight: 700; letter-spacing: .06em; color: var(--lilac); pointer-events: none; }
.pair input, .pair textarea { padding-right: 2.2rem !important; }
.pair textarea { min-height: 2.6rem; }
.b-q { border: 1.5px solid var(--line); border-radius: 16px; padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; transition: border-color var(--t); }
.b-q:hover { border-color: var(--lilac); }
.b-q.collapsed .b-q-body { display: none; }
.b-q-head { display: flex; align-items: center; gap: .6rem; }
.b-q-title { flex: 1; font-weight: 500; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-q-title .muted { font-weight: 400; }
.b-q-type { font-size: .72rem; padding: .2rem .55rem; border-radius: var(--r-pill); background: #f1eef6; color: var(--grape); font-weight: 600; white-space: nowrap; }
.b-q-req { color: var(--danger); font-weight: 700; }
.b-q-body { margin-top: .9rem; display: flex; flex-direction: column; gap: .7rem; }
.b-row { display: flex; flex-direction: row; gap: .75rem; align-items: center; flex-wrap: wrap; }
.b-row select { width: auto; }
.b-row label.check { margin: 0; }
.b-options { display: flex; flex-direction: column; gap: .4rem; }
.b-option { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; }
.icon-btn { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 1rem; padding: .3rem .4rem; border-radius: 8px; line-height: 1; }
.icon-btn:hover { background: var(--bg); color: var(--grape); }
.icon-btn.del:hover { color: var(--danger); }
.b-section-head .icon-btn { color: var(--lilac); }
.b-section-head .icon-btn:hover { background: rgba(255,255,255,.08); color: var(--cream); }
.b-add { display: flex; gap: .5rem; flex-wrap: wrap; }
.sublabel { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.b-q.dragging { opacity: .4; }
.drag-handle { cursor: grab; color: var(--lilac); user-select: none; padding: 0 .2rem; }

/* ── Client ── */
body.client { background: var(--bg); }
.client-hero { background: var(--prussian); padding: 1.1rem 1.5rem; }
.client-hero-inner { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.lang-switch { display: flex; background: rgba(255,255,255,.07); border-radius: var(--r-pill); padding: .2rem; }
.lang-switch a { color: var(--lilac); text-decoration: none; font-size: .8rem; font-weight: 600; padding: .35rem .8rem; border-radius: var(--r-pill); }
.lang-switch a.active { background: var(--cream); color: var(--prussian); }
.client-main { max-width: 760px; margin: 0 auto; padding: 0 1rem 3rem; }
.client-intro {
  color: var(--cream); background: var(--prussian); padding: 1.5rem 0 4.5rem; margin-bottom: -3rem;
  box-shadow: 0 0 0 100vmax var(--prussian); clip-path: inset(0 -100vmax);
}
.client-main > .flash { margin-top: 1rem; }
.client-intro h1 { color: var(--cream); font-size: 2.2rem; margin-bottom: .35rem; }
.client-intro .muted { color: rgba(241,218,196,.65); margin: 0; }
.client-greeting { margin: 0 0 .25rem; font-weight: 500; }
.client-card { background: #fff; border-radius: var(--r-card); box-shadow: var(--shadow-md); padding: 2rem; }
.client-footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 1rem 2rem; }
.client-footer a { color: var(--muted); }

.progress { position: relative; background: #fff; border-radius: 18px; padding: 1rem 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--prussian); margin-bottom: .5rem; }
.progress-label .muted { font-weight: 400; }
.progress-bar { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; }
#progress-fill { height: 100%; background: linear-gradient(90deg, var(--grape), var(--lilac)); width: 0; transition: width .4s ease; }
.steps { display: flex; gap: .3rem; list-style: none; padding: 0; margin: .7rem 0 0; flex-wrap: wrap; }
.steps li { font-size: .74rem; padding: .2rem .6rem; border-radius: var(--r-pill); background: var(--bg); color: var(--muted); cursor: pointer; }
.steps li.done { color: var(--grape); }
.steps li.current { background: var(--grape); color: var(--cream); }

.step h2 { font-size: 1.6rem; margin-bottom: .25rem; }
.step > p.muted { margin-top: 0; }
.field { margin: 1.6rem 0; }
.field-label { font-size: 1rem; font-weight: 600; color: var(--prussian); display: block; margin-bottom: .35rem; }
.req { color: var(--danger); }
.field-help { font-size: .86rem; color: var(--muted); margin: -.15rem 0 .55rem; }
.field.has-error input:not([type=radio]):not([type=checkbox]), .field.has-error textarea, .field.has-error select, .field.has-error .options, .field.has-error .dropzone { border-color: var(--danger); }
.field.has-error .options { border: 1.5px solid var(--danger); border-radius: 14px; padding: .4rem; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: .4rem; }
.options { display: flex; flex-direction: column; gap: .45rem; }
.options-inline { flex-direction: row; flex-wrap: wrap; }
.option { flex-direction: row; align-items: center; gap: .7rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; font-weight: 400; transition: border-color var(--t), background var(--t); }
.option:hover { border-color: var(--lilac); }
.option:has(input:checked) { border-color: var(--grape); background: #f6f4fa; }
.options-inline .option { min-width: 110px; }
.option-other input[type=text] { flex: 1; padding: .4rem .7rem; }
.option-other span { white-space: nowrap; }
.scale { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.scale-dot { flex-direction: row; cursor: pointer; }
.scale-dot input { position: absolute; opacity: 0; pointer-events: none; }
.scale-dot span { width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line); font-weight: 600; transition: all var(--t); }
.scale-dot:hover span { border-color: var(--lilac); }
.scale-dot input:checked + span { background: var(--grape); color: var(--cream); border-color: var(--grape); }
.scale-dot input:focus-visible + span { box-shadow: 0 0 0 4px rgba(71,73,115,.18); }
.info-box { background: #f6f4fa; border-left: 3px solid var(--grape); border-radius: 12px; padding: .9rem 1.1rem; font-size: .92rem; margin: 1.5rem 0; }
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 1.6rem 1rem; text-align: center; cursor: pointer; color: var(--grape); font-weight: 500; transition: border-color var(--t), background var(--t); }
.dropzone:hover, .dropzone.over { border-color: var(--grape); background: #f6f4fa; }
.file-list { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: var(--bg); border-radius: 10px; padding: .5rem .8rem; font-size: .88rem; }
.file-list li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li.uploading { color: var(--muted); }
.file-list li.error { color: var(--danger); }
.step-nav { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.5rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.step-nav .btn-primary { margin-left: auto; }
.form-error { color: var(--danger); background: #fbecee; border-radius: 12px; padding: .75rem 1rem; margin-top: 1rem; font-size: .9rem; }
.thanks { text-align: center; padding: 3rem 2rem; margin-top: 1rem; }
.thanks-icon { width: 4rem; height: 4rem; border-radius: 50%; background: var(--grape); color: var(--cream); display: grid; place-items: center; font-size: 1.8rem; margin: 0 auto 1rem; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .layout-2 { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: .75rem 1rem; padding: .8rem 1rem; }
  .topbar nav { order: 3; flex-basis: 100%; }
  .sticky-head { top: 0; position: static; }
}
@media (max-width: 640px) {
  .container { padding: 1.25rem 1rem; }
  .grid-2, .pair, .b-option { grid-template-columns: 1fr; }
  .b-option .icon-btn { justify-self: end; }
  .answer { grid-template-columns: 1fr; gap: .15rem; }
  .search, .search input { width: 100%; min-width: 0; }
  .client-card { padding: 1.4rem 1.1rem; }
  .client-intro h1 { font-size: 1.7rem; }
  .steps { display: none; }
  .b-section-head { grid-template-columns: 1fr; }
  h1 { font-size: 1.6rem; }
}

/* ── Login extras & two-factor ── */
.login-card h2 { margin-top: 1rem; }
.login-card > p.small { margin: 1rem 0 0; }
.code-input { font-family: ui-monospace, Consolas, monospace; font-size: 1.4rem !important; letter-spacing: .3em; text-align: center; max-width: 220px; }
.login-card .code-input { max-width: none; }
.setup-steps { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.qr { width: 200px; margin: .75rem 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: auto; }
.secret { display: inline-block; margin-top: .5rem; font-size: .95rem; background: var(--bg); padding: .4rem .7rem; border-radius: 8px; letter-spacing: .05em; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; background: var(--bg); padding: 1rem; border-radius: 14px; }
.recovery-codes code { font-size: 1rem; text-align: center; }
