/* ── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.btn--primary {
  background: var(--gray-900);
  color: var(--white);

  &:hover { background: var(--gray-700); }
}

.btn--secondary {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);

  &:hover { background: var(--gray-50); }
}

.btn--danger {
  color: var(--red-400);

  &:hover {
    color: var(--red-600);
    background: var(--red-50);
  }
}

.btn--link {
  color: var(--gray-500);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius);

  &:hover {
    color: var(--gray-900);
    background: var(--gray-50);
  }
}

.btn--small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn--block {
  width: 100%;
}

/* ── Inputs ─────────────────────────────────────────────────────────── */

.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-300);
  font-size: 0.875rem;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s;

  &:focus {
    border-color: var(--gray-900);
    outline: none;
    box-shadow: 0 0 0 1px var(--gray-900);
  }

  &::placeholder {
    color: var(--gray-400);
  }
}

textarea.input {
  resize: vertical;
}

/* ── Fields ─────────────────────────────────────────────────────────── */

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field__label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-700);
}

.field__hint {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.field__error {
  font-size: 0.75rem;
  color: var(--red-700);
  margin-top: 0.375rem;
}

/* ── Cards ──────────────────────────────────────────────────────────── */

.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.card__title {
  font-weight: 500;
  font-size: 1rem;
  color: var(--gray-900);
}

.card__count {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.card__body {
  padding: 1.5rem;
}

.card__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* ── Badges ─────────────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
}

.badge--green {
  background: var(--green-100);
  color: var(--green-700);
}

.badge--yellow {
  background: var(--yellow-100);
  color: var(--yellow-700);
}

.badge--gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ── Flash messages ────────────────────────────────────────────────── */

.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius-lg);
}

.flash--fixed {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
}

.flash--notice {
  background: var(--green-50);
  border: 1px solid var(--green-200);
  color: var(--green-800);
}

.flash--alert {
  background: var(--red-50);
  border: 1px solid var(--red-200);
  color: var(--red-700);
}

.flash__dismiss {
  margin-left: 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;

  &:hover { opacity: 1; }
}

/* ── Breadcrumb ────────────────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  &:hover { color: var(--gray-900); }
}

.breadcrumb__current {
  color: var(--gray-600);
}

/* ── Tabs ───────────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--gray-100);
  padding-inline: 1rem;
}

.tab-btn {
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;

  &:hover { color: var(--gray-900); }
}

.tab-btn.tab-active {
  color: var(--gray-900);
  border-bottom-color: var(--gray-900);
}

.locale-tab-bar {
  margin-block: 0.75rem 0;
  padding-inline: 0;
  border-bottom-color: var(--gray-200);
}

.tab-btn--locale {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
}

.locale-tab__badge {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.locale-tab__dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--green-700);
}

.locale-tabs__panel {
  padding-top: 0.75rem;
}

/* ── Error list ────────────────────────────────────────────────────── */

.errors {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--red-50);
  border: 1px solid var(--red-200);
}

.errors ul {
  list-style: disc inside;
  font-size: 0.875rem;
  color: var(--red-700);
}

.errors li + li {
  margin-top: 0.25rem;
}

/* ── Sortable ──────────────────────────────────────────────────────── */

.sortable-ghost {
  opacity: 0.4;
}

/* ── File input ────────────────────────────────────────────────────── */

.file-input {
  font-size: 0.875rem;
  color: var(--gray-600);

  &::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    border: none;
    background: var(--gray-100);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-700);
    cursor: pointer;
  }

  &::file-selector-button:hover {
    background: var(--gray-200);
  }
}

/* ── Color swatch ──────────────────────────────────────────────────── */

.swatch {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s;

  &:hover { transform: scale(1.1); }
}

/* ── Legal prose ───────────────────────────────────────────────────── */

.legal-prose {
  line-height: 1.75;
  color: var(--gray-700);
}

.legal-prose h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--stone-900);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.legal-prose h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--stone-900);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--stone-200);
}

.legal-prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--stone-800);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-prose p { margin-bottom: 1rem; }

.legal-prose ul,
.legal-prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.legal-prose ul { list-style-type: disc; }
.legal-prose ol { list-style-type: decimal; }
.legal-prose li { margin-bottom: 0.25rem; }

.legal-prose a {
  color: var(--blue-600);
  text-decoration: underline;
  &:hover { color: var(--blue-700); }
}

.legal-prose strong {
  font-weight: 600;
  color: var(--stone-800);
}

.legal-prose hr {
  border: none;
  border-top: 1px solid var(--stone-200);
  margin: 2rem 0;
}

.legal-prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.legal-prose thead th {
  text-align: left;
  font-weight: 600;
  color: var(--stone-900);
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid var(--stone-300);
  background: var(--stone-50);
}

.legal-prose tbody td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--stone-200);
  vertical-align: top;
}

.legal-prose blockquote {
  border-left: 3px solid var(--stone-300);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--stone-500);
  font-style: italic;
}

@media (max-width: 640px) {
  .legal-prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .legal-prose h1 { font-size: 1.5rem; }
}

/* ── Language toggle ───────────────────────────────────────────────── */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--stone-100);
  border-radius: var(--radius);
  padding: 3px;
}

.lang-toggle__btn {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--stone-600);
  background: none;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.lang-toggle__btn:is(.active, :hover) {
  background: var(--white);
  color: var(--stone-900);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* ── Legal layout ─────────────────────────────────────────────────── */

.legal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 248, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-100);
}

.legal-header__inner {
  padding-block: 1rem;
}

.legal-header__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.legal-header__right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.legal-header__logo {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--stone-900);
  letter-spacing: -0.02em;
}

.legal-header__signin {
  font-size: 0.875rem;
  color: var(--stone-500);
}

.legal-main {
  padding-block: 2rem 3rem;
}

.legal-footer {
  border-top: 1px solid var(--gray-100);
  margin-top: 3rem;
  padding: 2rem 0;
}

.legal-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--stone-400);
}

.legal-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.legal-footer__separator {
  color: var(--stone-300);
}
