/* NASABA components — class names reused by every milestone. */

.stack { display: flex; flex-direction: column; gap: var(--s3); }
.stack--lg { gap: var(--s5); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row--wrap { flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--s4);
}
.card--highlight {
  border-color: color-mix(in srgb, var(--gold) 45%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 10%, var(--surface)), var(--surface));
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--tap); padding: 10px 20px;
  font: 600 var(--fs-sm) / 1 var(--font-body);
  border-radius: var(--radius-pill); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: transform .12s ease, filter .12s ease;
}
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--leaf); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn--quiet { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.btn--danger { background: transparent; border-color: var(--root); color: var(--root); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 6px 14px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.field .hint { font-size: var(--fs-xs); color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 12px 14px;
  font: 400 var(--fs-md) var(--font-body); color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-field);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--leaf); outline-offset: 1px; border-color: transparent; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--root); }
.field__error { font-size: var(--fs-xs); color: var(--root); font-weight: 600; }
.field__row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.field__row > .field { flex: 1 1 160px; }

/* Chips & badges */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
}
.chip--leaf { color: var(--leaf); border-color: color-mix(in srgb, var(--leaf) 40%, var(--border)); }
.chip--root { color: var(--root); border-color: color-mix(in srgb, var(--root) 40%, var(--border)); }
.chip--gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); }
.kin-label { font-size: var(--fs-xs); font-weight: 600; color: var(--gold); }

/* Avatars — ring encodes status (spec §9.4) */
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: var(--surface-2); color: var(--text); font-weight: 700; font-size: var(--fs-sm);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 92px; height: 92px; font-size: 1.6rem; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar--active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--leaf); }
.avatar--passive { outline: 1.5px dashed var(--muted); outline-offset: 2px; }
.avatar--admin { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--gold); }
.avatar--deceased { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--root); }

/* Flash messages */
.flash { padding: var(--s3) var(--s4); border-radius: var(--radius-field); font-size: var(--fs-sm); font-weight: 500; border: 1px solid var(--border); }
.flash--ok { border-color: color-mix(in srgb, var(--leaf) 50%, var(--border)); background: color-mix(in srgb, var(--leaf) 12%, var(--surface)); }
.flash--error { border-color: color-mix(in srgb, var(--root) 50%, var(--border)); background: color-mix(in srgb, var(--root) 12%, var(--surface)); }

/* Divider with label */
.or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--fs-xs); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Empty state */
.empty { text-align: center; padding: var(--s6) var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s3); }
.empty svg { width: 72px; height: 72px; color: var(--gold); }

/* Language / theme switches */
.switches { display: flex; justify-content: center; align-items: center; gap: var(--s3); font-size: var(--fs-sm); flex-wrap: wrap; }
.switches a { color: var(--muted); text-decoration: none; padding: 6px 8px; border-radius: 8px; }
.switches a[aria-current="true"] { color: var(--leaf); font-weight: 700; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.flash { display: flex; align-items: flex-start; gap: var(--s2); transition: opacity .3s, transform .3s; }
.flash__icon { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--on-accent); background: var(--leaf); }
.flash--error .flash__icon { background: var(--root); color: #fff; }
.flash__text { flex: 1; min-width: 0; padding-top: 1px; }
.flash__close { background: none; border: 0; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; }
.flash.is-hiding { opacity: 0; transform: translateY(-6px); }
@media (prefers-reduced-motion: reduce) { .flash { transition: none; } }
button[disabled].is-busy, .btn.is-busy { opacity: .6; cursor: progress; }
/* language picker: segmented pill */
.langs { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); }
.langs > svg { width: 16px; height: 16px; color: var(--gold); margin: 0 4px 0 6px; flex: none; }
.langs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: var(--fs-xs); letter-spacing: .06em; transition: background .15s, color .15s; }
.langs a:hover { color: var(--text); background: color-mix(in srgb, var(--leaf) 10%, transparent); }
.langs a[aria-current="true"] { background: var(--leaf); color: var(--on-accent); box-shadow: 0 0 12px color-mix(in srgb, var(--leaf) 45%, transparent); }
.langs__name { display: none; }
.langs--compact a { padding: 4px 9px; }
.menu__langs { padding: 6px 6px 8px; border-top: 1px solid var(--border); margin-top: 4px; display: flex; justify-content: center; }
.menu__langs .langs a { padding: 6px 10px; }
.menu__langs .langs a:hover, .menu__panel .langs a { width: auto; }
.theme-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: var(--fs-xs); text-decoration: none; cursor: pointer; }
.theme-pill svg { width: 15px; height: 15px; }
.switches { gap: var(--s2); }
@media (prefers-reduced-motion: reduce) { .langs a { transition: none; } }
