/* ==========================================================================
   Zibuse Group — forms, tools and utility components
   ========================================================================== */

/* ---------- Fields ---------- */
.form { display: grid; gap: 20px; }
.form-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } }

.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }

.field label,
.label {
  font-family: var(--font-display);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--navy);
}
.field .hint { font-size: 0.82rem; color: var(--muted); margin: 0; }

.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field select { cursor: pointer; }

.field input:hover,
.field textarea:hover,
.field select:hover { border-color: var(--silver-300); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(44,94,140,.14);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] { border-color: var(--error); }

.field__error {
  font-size: 0.84rem; color: var(--error); margin: 0;
  display: flex; align-items: center; gap: 6px;
}
.field__error::before { content: "!"; font-weight: 700; }

.field--check { flex-direction: row; align-items: flex-start; gap: 11px; }
.field--check input { width: auto; margin-top: 3px; flex-shrink: 0; }
.field--check label { font-weight: 400; font-size: 0.92rem; color: var(--body); line-height: 1.5; }

/* Honeypot — visually and audibly hidden, but focusable by bots */
.trap {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0;
}

/* ---------- Form status ---------- */
.form-status {
  padding: 15px 18px; border-radius: var(--radius);
  font-size: 0.94rem; line-height: 1.55; border: 1px solid;
}
.form-status--ok    { background: var(--ok-bg);    border-color: #BFE0D2; color: #14503C; }
.form-status--warn  { background: var(--warn-bg);  border-color: #E8D5A8; color: #6E4C10; }
.form-status--error { background: var(--error-bg); border-color: #EFC5BF; color: #7E271E; }

/* ---------- Notices ---------- */
.notice {
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.94rem;
  color: var(--body);
}
.notice strong { color: var(--navy); }
.notice--info { border-left-color: var(--navy-500); }

.access-note {
  font-size: 0.82rem; color: var(--warn);
  background: var(--warn-bg); border-radius: var(--radius);
  padding: 8px 11px; margin: 0;
}

.muted { color: var(--muted); }

/* ---------- Chips / filters ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  font-family: var(--font-display); font-size: 0.82rem; font-weight: 500;
  padding: 8px 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white);
  color: var(--body); cursor: pointer; text-decoration: none;
  transition: all .2s var(--ease); line-height: 1;
}
.chip:hover { border-color: var(--navy-500); color: var(--navy); }
.chip[aria-pressed="true"] {
  background: var(--navy); border-color: var(--navy); color: var(--white);
}

/* ---------- Tags ---------- */
.tag {
  display: inline-block;
  font-family: var(--font-display); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 3px;
  background: var(--paper-2); color: var(--muted);
}
.tag--watch  { background: #E8F0F7; color: #1D4368; }
.tag--listen { background: #F2ECF7; color: #55407A; }
.tag--read   { background: #EAF5F0; color: #1F7A5C; }
.tag--practise { background: var(--warn-bg); color: var(--warn); }

/* ---------- Tool shell ---------- */
.tool {
  display: grid; gap: clamp(24px, 3vw, 44px);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 1000px) {
  .tool--split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tool__preview { position: sticky; top: 96px; }
}

.tool-panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 34px);
}
.tool-panel + .tool-panel { margin-top: 20px; }
.tool-panel > h3 { margin-bottom: 6px; }
.tool-panel__intro { font-size: 0.94rem; color: var(--muted); margin-bottom: 22px; }

/* Steps / progress */
.tool-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tool-step {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); color: var(--muted);
  cursor: pointer; transition: all .2s var(--ease);
}
.tool-step[aria-current="step"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tool-step[data-done="true"] { border-color: var(--ok); color: var(--ok); }

/* Repeatable entries */
.entry {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; background: var(--paper);
}
.entry__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.entry__title { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.entry__actions { display: flex; gap: 6px; }
.icon-btn {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: var(--white); border-radius: var(--radius);
  cursor: pointer; color: var(--muted); font-size: 0.9rem; line-height: 1;
}
.icon-btn:hover { border-color: var(--navy-500); color: var(--navy); }
.icon-btn--danger:hover { border-color: var(--error); color: var(--error); }

/* CV preview */
.cv-preview {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  aspect-ratio: 210 / 297;
  overflow: hidden;
  position: relative;
}
.cv-preview__scale { transform-origin: top left; }
.preview-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px;
}

/* Template picker */
.templates { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.template-opt {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 13px; background: var(--white); cursor: pointer; text-align: left;
  transition: all .2s var(--ease);
}
.template-opt:hover { border-color: var(--silver-300); }
.template-opt[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(20,48,79,.10); }
.template-opt__name { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 0.9rem; }
.template-opt__desc { font-size: 0.78rem; color: var(--muted); margin-top: 3px; }

/* Resource grid */
.resource-count { font-size: 0.88rem; color: var(--muted); }

/* Empty state */
.empty {
  text-align: center; padding: clamp(40px, 6vw, 72px) 24px;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--paper-2);
}
.empty h3 { margin-bottom: 10px; }
.empty p { color: var(--muted); max-width: 46ch; margin-inline: auto; }

/* Page hero (non-home) */
.page-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--navy-900); }
.page-hero__img { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.page-hero__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .72; }
.page-hero__scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(8,23,38,.88) 0%, rgba(8,23,38,.62) 45%, rgba(8,23,38,.22) 100%);
}
.page-hero__inner { padding-block: clamp(120px, 16vh, 180px) clamp(56px, 8vh, 92px); }
.page-hero h1 { color: var(--white); max-width: 18ch; text-shadow: 0 2px 24px rgba(4,23,48,.55); }
.page-hero p { color: rgba(255,255,255,.88); max-width: 52ch; margin-top: 20px; font-size: var(--step-1); text-shadow: 0 1px 16px rgba(4,23,48,.55); }
.page-hero .btn-row { margin-top: 32px; }

/* Breadcrumb */
.crumbs {
  font-size: 0.8rem; color: rgba(255,255,255,.60);
  margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap;
}
.crumbs a { color: rgba(255,255,255,.75); text-decoration: none; }
.crumbs a:hover { color: var(--white); }

/* Definition list for service details */
.deflist { display: grid; gap: 0; }
.deflist > div {
  display: grid; gap: 4px 24px; padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
}
@media (min-width: 700px) { .deflist > div { grid-template-columns: 220px 1fr; } }
.deflist dt { font-family: var(--font-display); font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.deflist dd { margin: 0; color: var(--body); font-size: 0.95rem; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  font-size: 0.96rem;
}
.checklist li::before {
  content: "✓"; color: var(--gold-deep); font-weight: 700; line-height: 1.5;
}
.dark .checklist li::before { color: var(--gold); }

/* Printable worksheet */
@media print {
  .site-header, .mobile-nav, .site-footer, .btn, .nav-toggle, .no-print { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .section { padding-block: 12pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
