/* Type16 — Components */

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 600; font-size: 15px; line-height: 1;
  border: 1px solid transparent;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  background: transparent; color: var(--text);
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 15px 26px; font-size: 16px; border-radius: 12px; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: var(--text); box-shadow: 0 6px 18px rgba(245,158,11,0.30); }
.btn-primary:hover { background: #ffae23; }
.btn-primary[disabled], .btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary { border: 2px solid var(--primary); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); }

.btn-ghost { color: var(--text); background: var(--surface); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); }

.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: var(--primary-2); }

.btn-on-dark-fill { background: #fff; color: var(--text); }
.btn-on-dark-outline { border: 2px solid rgba(255,255,255,0.7); color: #fff; }
.btn-on-dark-outline:hover { background: rgba(255,255,255,0.08); border-color: #fff; }

.btn-link { color: var(--primary); padding: 0; font-weight: 600; gap: 4px; background: none; border: none; }
.btn-link:hover { color: var(--primary-2); }

.btn-danger { color: var(--error); border: 1px solid #FCA5A5; background: #fff; }
.btn-danger:hover { background: var(--error-bg); }

.arrow-after::after { content: "→"; margin-left: 2px; transition: transform .15s ease; }
.btn:hover .arrow-after::after, .btn.arrow-after:hover::after { transform: translateX(3px); }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  border: 1px solid var(--border-2);
}
.card-flat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.card-elev { box-shadow: var(--shadow-lg); }
.card-outline-primary { border: 2px solid var(--primary); }

/* Badges / tags */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-full);
  font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--surface-2); color: var(--text-2);
}
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-accent { background: var(--accent-soft); color: #8a5a08; }
.tag-success { background: var(--success-bg); color: var(--success); }
.tag-error { background: var(--error-bg); color: var(--error); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-dark { background: var(--primary); color: #fff; }
.tag-outline { background: transparent; border: 1px solid var(--border); }

/* Inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--text); }
.field-hint { font-size: 12px; color: var(--text-2); }
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(61,43,122,0.12);
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.input[disabled] { background: var(--bg); color: var(--text-2); }

.input-with-icon { position: relative; }
.input-with-icon .icn { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.input-with-icon .input { padding-left: 40px; }

.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.checkbox input { appearance: none; width: 18px; height: 18px; min-width: 18px; margin-top: 2px;
  border: 1.5px solid var(--border); border-radius: 4px; background: #fff; position: relative; cursor: pointer; }
.checkbox input:checked { background: var(--primary); border-color: var(--primary); }
.checkbox input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* Toggle */
.toggle { width: 40px; height: 22px; background: var(--border); border-radius: 999px; position: relative; cursor: pointer; transition: background .15s ease; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: left .15s ease; }
.toggle.on { background: var(--primary); }
.toggle.on::after { left: 20px; }

/* Header — sticky on the wrapper so the wrapper has the full page as its containing block.
   Sticking the inner .site-header would only stick within the wrapper's own 68px height. */
[data-chrome="header"] { position: sticky; top: 0; z-index: 30; }
.site-header { background: rgba(255,255,255,0.85); backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--border-2); }
.site-header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--text); }
.brand-mark { width: 22px; height: 22px; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 2px; }
.brand-mark span { background: var(--primary); border-radius: 1px; }
.brand-mark span:nth-child(6), .brand-mark span:nth-child(11) { background: var(--accent); }
.brand-mark span:nth-child(3), .brand-mark span:nth-child(14) { opacity: .45; }

.nav { display: flex; gap: 4px; align-items: center; }
.nav a { font-size: 14.5px; font-weight: 500; color: var(--text-2); padding: 8px 14px; border-radius: 8px; transition: color .15s ease, background .15s ease; }
.nav a:hover { color: var(--text); background: var(--bg); }
.nav a.active { color: var(--primary); background: var(--primary-soft); }

.header-cta { display: flex; gap: 10px; align-items: center; }
.hamburger { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; width: 40px; height: 40px; align-items: center; justify-content: center; }

@media (max-width: 860px) {
  .nav { display: none; }
  .header-cta .btn-secondary { display: none; }
  .hamburger { display: inline-flex; }
}

/* Footer */
.site-footer { background: var(--text); color: rgba(255,255,255,0.65); padding: 56px 0 32px; }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.footer-grid h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { color: rgba(255,255,255,0.65); font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; font-size: 13px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Type tile (used across many pages) */
.type-tile {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px;
  border-radius: var(--r-lg);
  aspect-ratio: 1;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease;
  border: 1px solid rgba(0,0,0,0.04);
}
.type-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.type-tile .code { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.type-tile .name { font-size: 13px; font-weight: 500; opacity: 0.85; }
.type-tile .meta { font-size: 11px; font-weight: 600; opacity: 0.6; letter-spacing: 0.08em; text-transform: uppercase; }

/* Scale row (I/E, N/S, T/F, J/P) */
.scale-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.scale-row .letter { font-weight: 700; width: 22px; text-align: center; }
.scale-row .bar { height: 8px; border-radius: 999px; background: rgba(0,0,0,0.08); position: relative; overflow: hidden; }
.scale-row .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); border-radius: 999px; }
.scale-row.on-dark .bar { background: rgba(255,255,255,0.18); }
.scale-row.on-dark .fill { background: #fff; }
.scale-row .pct { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: right; }

/* Pill / breadcrumb */
.breadcrumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs .sep { color: var(--text-3); }

/* Highlight box */
.highlight {
  background: rgba(61,43,122,0.06);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  font-size: 15px;
}
.highlight.accent { background: var(--warn-bg); border-left-color: var(--accent); }
.highlight.success { background: var(--success-bg); border-left-color: var(--success); }

/* Step indicator (3-step booking, etc.) */
.steps { display: flex; gap: 8px; align-items: center; }
.steps .dot { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.steps .dot.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.steps .dot.done { background: var(--success); color: #fff; border-color: var(--success); }
.steps .line { flex: 1; height: 2px; background: var(--border); border-radius: 2px; min-width: 16px; max-width: 60px; }
.steps .line.done { background: var(--primary); }

/* Avatar circle */
.avatar { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--primary); flex-shrink: 0; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-xl { width: 120px; height: 120px; font-size: 36px; }

/* Stars */
.stars { color: var(--accent); letter-spacing: 2px; font-size: 14px; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 24px 0; }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Accordion */
.accordion { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-trigger { width: 100%; padding: 18px 0; display: flex; justify-content: space-between; align-items: center; background: none; border: none; font: inherit; text-align: left; font-weight: 600; font-size: 16px; cursor: pointer; }
.accordion-trigger .chev { transition: transform .2s ease; color: var(--text-2); }
.accordion-item.open .chev { transform: rotate(180deg); color: var(--primary); }
.accordion-body { display: none; padding: 0 0 18px; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.accordion-item.open .accordion-body { display: block; }

/* Progress bar (test) */
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress .fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s ease; }

/* Toast */
.toast-portal { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-portal .toast { pointer-events: all; animation: toastIn .25s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.toast-exiting { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
.toast { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-lg); border-left: 4px solid var(--primary); min-width: 320px; max-width: 420px; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--info); }
.toast .icn { color: var(--primary); margin-top: 2px; flex-shrink: 0; }
.toast.success .icn { color: var(--success); }
.toast.error .icn { color: var(--error); }
.toast.info .icn { color: var(--info); }
.toast .toast-close { margin-left: auto; background: none; border: none; color: var(--text-3); cursor: pointer; padding: 0 0 0 8px; font-size: 16px; line-height: 1; align-self: flex-start; flex-shrink: 0; }
@media (max-width: 480px) { .toast-portal { left: 16px; right: 16px; bottom: 16px; } .toast { min-width: unset; } }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,12,46,0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal { background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-xl); padding: 28px; max-width: 480px; width: 100%; position: relative; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; width: 36px; height: 36px; border-radius: 50%; color: var(--text-2); display: inline-flex; align-items: center; justify-content: center; }
.modal-close:hover { background: var(--bg); color: var(--text); }

/* Page header band (eg /types, /blog top hero) */
.page-band { padding: 80px 0 56px; text-align: center; background: var(--bg); }
.page-band p { color: var(--text-2); font-size: 17px; max-width: 600px; margin: 12px auto 0; }

/* Visually-hidden */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Cookie banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 8000; background: #fff; border-top: 1px solid var(--border-2); box-shadow: 0 -6px 20px rgba(20,12,46,0.06); padding: 16px 0; animation: cookieIn .3s ease; }
@keyframes cookieIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cookie-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.cookie-row .row { gap: 12px; flex-shrink: 0; }
