/* Tidbok – bokningssidan. Färgerna --tb-accent, --tb-bg och --tb-ink sätts per kund. */

:root {
  --tb-accent: #1d4ed8;
  --tb-on-accent: #ffffff;
  --tb-bg: #ffffff;
  --tb-ink: #111111;
  --tb-muted: #5b5b5b;
  --tb-line: #d9d9d9;
  --tb-soft: #f4f4f4;
  --tb-accent-soft: #e8eefc;
  --tb-danger: #b42318;
  --tb-danger-soft: #fdecea;
  --tb-ok: #17663a;
  --tb-radius: 10px;
}

@supports (color: color-mix(in srgb, red, blue)) {
  :root {
    --tb-muted: color-mix(in srgb, var(--tb-ink) 66%, var(--tb-bg));
    --tb-line: color-mix(in srgb, var(--tb-ink) 18%, var(--tb-bg));
    --tb-soft: color-mix(in srgb, var(--tb-ink) 5%, var(--tb-bg));
    --tb-accent-soft: color-mix(in srgb, var(--tb-accent) 11%, var(--tb-bg));
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.tb-body {
  margin: 0;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.tb {
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

.tb-embed .tb {
  padding: 4px 2px 16px;
}

.tb-head {
  margin-bottom: 20px;
}

.tb-client {
  margin: 0 0 2px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tb-muted);
}

.tb-title {
  margin: 0 0 6px;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.tb-intro {
  margin: 0;
  color: var(--tb-muted);
  max-width: 46ch;
}

.tb a {
  color: var(--tb-accent);
  text-underline-offset: 2px;
}

/* Steg */

.tb-step {
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius);
  margin-bottom: 12px;
  background: var(--tb-bg);
}

.tb-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 56px;
}

.tb-step-num {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: var(--tb-soft);
  color: var(--tb-muted);
}

.tb-step.is-current .tb-step-num,
.tb-step.is-done .tb-step-num {
  background: var(--tb-accent);
  color: var(--tb-on-accent);
}

.tb-step-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.3;
}

.tb-step-title:focus {
  outline: none;
}

.tb-step.is-pending .tb-step-title {
  color: var(--tb-muted);
  font-weight: 500;
}

.tb-step-text {
  flex: 1;
  min-width: 0;
}

.tb-step-value {
  margin: 0;
  color: var(--tb-muted);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.tb-step-body {
  padding: 0 16px 16px;
}

/* Knappar */

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.tb-btn:hover {
  border-color: var(--tb-ink);
}

.tb-btn:focus-visible,
.tb-link:focus-visible,
.tb-service:focus-visible,
.tb-day:focus-visible,
.tb-time:focus-visible,
.tb input:focus-visible,
.tb textarea:focus-visible,
.tb a:focus-visible {
  outline: 3px solid var(--tb-accent);
  outline-offset: 2px;
}

.tb-btn-primary {
  background: var(--tb-accent);
  border-color: var(--tb-accent);
  color: var(--tb-on-accent);
}

.tb a.tb-btn-primary {
  color: var(--tb-on-accent);
}

.tb-btn-primary:hover {
  filter: brightness(0.93);
  border-color: var(--tb-accent);
}

.tb-btn-danger {
  background: var(--tb-danger);
  border-color: var(--tb-danger);
  color: #ffffff;
}

.tb-btn-quiet {
  border-color: transparent;
  color: var(--tb-ink);
}

.tb a.tb-btn-quiet {
  color: var(--tb-ink);
  text-decoration: underline;
}

.tb-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.tb-btn-wide {
  width: 100%;
}

.tb-link {
  flex: none;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: var(--tb-accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* Tjänster */

.tb-services {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tb-service {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tb-service:hover {
  border-color: var(--tb-accent);
  background: var(--tb-accent-soft);
}

.tb-service-name {
  font-weight: 600;
}

.tb-service-meta {
  flex: none;
  color: var(--tb-muted);
  font-size: 0.92rem;
  text-align: right;
}

/* Vecka och dagar */

.tb-week {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.tb-week-label {
  margin: 0;
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 0.98rem;
}

.tb-week-label small {
  display: block;
  color: var(--tb-muted);
  font-weight: 400;
  font-size: 0.85rem;
}

.tb-nav {
  flex: none;
  width: 48px;
  height: 48px;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.tb-nav:hover:not([disabled]) {
  border-color: var(--tb-ink);
}

.tb-nav:focus-visible {
  outline: 3px solid var(--tb-accent);
  outline-offset: 2px;
}

.tb-nav[disabled] {
  opacity: 0.35;
  cursor: default;
}

.tb-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.tb-day {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-height: 60px;
  padding: 8px 2px;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
  cursor: pointer;
}

.tb-day-name {
  font-size: 0.78rem;
  color: var(--tb-muted);
}

.tb-day-num {
  font-size: 1.1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tb-day:hover:not([disabled]) {
  border-color: var(--tb-accent);
}

.tb-day[disabled] {
  background: var(--tb-soft);
  border-color: transparent;
  cursor: default;
}

.tb-day[disabled] .tb-day-num {
  color: var(--tb-muted);
  font-weight: 400;
  text-decoration: line-through;
}

.tb-day[aria-pressed="true"] {
  background: var(--tb-accent);
  border-color: var(--tb-accent);
  color: var(--tb-on-accent);
}

.tb-day[aria-pressed="true"] .tb-day-name {
  color: var(--tb-on-accent);
}

.tb-times-title {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 600;
}

.tb-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}

.tb-time {
  min-height: 48px;
  padding: 8px 6px;
  border: 1px solid var(--tb-line);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.tb-time:hover {
  border-color: var(--tb-accent);
  background: var(--tb-accent-soft);
}

.tb-time-wide {
  grid-column: 1 / -1;
}

.tb-note {
  margin: 0;
  color: var(--tb-muted);
}

/* Formulär */

.tb-field {
  margin-bottom: 14px;
}

.tb-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.98rem;
}

.tb-optional {
  font-weight: 400;
  color: var(--tb-muted);
}

.tb-field input[type="text"],
.tb-field input[type="tel"],
.tb-field input[type="email"],
.tb-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--tb-muted);
  border-radius: 8px;
  background: var(--tb-bg);
  color: var(--tb-ink);
  font: inherit;
}

.tb-field textarea {
  min-height: 84px;
  resize: vertical;
}

.tb-field input[aria-invalid="true"],
.tb-field textarea[aria-invalid="true"] {
  border-color: var(--tb-danger);
  border-width: 2px;
}

.tb-hint {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--tb-muted);
}

.tb-error {
  margin: 4px 0 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tb-danger);
}

.tb-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 6px;
}

.tb-check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--tb-accent);
}

.tb-check label {
  font-weight: 400;
  font-size: 0.95rem;
}

.tb-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tb-alert {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--tb-danger-soft);
  color: var(--tb-danger);
  font-weight: 600;
}

.tb-alert:focus {
  outline: none;
}

/* Bekräftelse och övriga sidor */

.tb-panel {
  border: 1px solid var(--tb-line);
  border-radius: var(--tb-radius);
  padding: 20px 18px;
}

.tb-panel > :first-child {
  margin-top: 0;
}

.tb-panel > :last-child {
  margin-bottom: 0;
}

.tb-panel .tb-title {
  font-size: 1.45rem;
  margin-bottom: 12px;
}

.tb-panel .tb-title:focus {
  outline: none;
}

.tb-done-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--tb-accent);
  color: var(--tb-on-accent);
  font-size: 1.4rem;
  font-weight: 700;
}

.tb-summary {
  margin: 0 0 16px;
  border-top: 1px solid var(--tb-line);
}

.tb-summary div {
  display: flex;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--tb-line);
}

.tb-summary dt {
  flex: none;
  width: 84px;
  color: var(--tb-muted);
}

.tb-summary dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.tb-panel form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tb-text h2 {
  margin: 22px 0 4px;
  font-size: 1.05rem;
}

.tb-text p {
  margin: 0 0 10px;
}

.tb-foot {
  margin-top: 22px;
  color: var(--tb-muted);
  font-size: 0.92rem;
}

.tb-foot p {
  margin: 0 0 4px;
}

.tb-credit {
  margin-top: 10px;
  font-size: 0.85rem;
}

.tb-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .tb-body {
    font-size: 16px;
  }

  .tb-title {
    font-size: 1.5rem;
  }

  .tb-step-head {
    padding: 12px;
  }

  .tb-step-body {
    padding: 0 12px 14px;
  }

  .tb-days {
    gap: 4px;
  }

  .tb-service {
    flex-direction: column;
    gap: 2px;
  }

  .tb-service-meta {
    text-align: left;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .tb-btn,
  .tb-service,
  .tb-day,
  .tb-time {
    transition: border-color 0.12s ease, background-color 0.12s ease;
  }
}
