/* Festivenomics auth surfaces (login + client portal), on tokens.css.
   Top bar per shell spec §2: 58px, sticky, rgba(10,10,10,.86) + blur,
   1px --line bottom border. */

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ambient glow — fixed, non-interactive, low alpha (spec §3) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 50% 0%, rgba(255, 138, 71, 0.09), transparent 70%),
    radial-gradient(45% 40% at 80% 100%, rgba(100, 238, 255, 0.07), transparent 70%);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  padding: 0 20px;
  box-sizing: border-box;
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brandmark {
  height: 34px;
  display: block;
}

.topbar-account {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* account chip: initial avatar with a streak-gradient ring (spec §2) */
.avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card2), var(--card2)) padding-box,
    var(--streak) border-box;
  font-family: var(--display);
  font-weight: 700;
  font-size: 12px;
  color: var(--txt);
  text-transform: uppercase;
}

.account-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
}

.logout {
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

.logout:hover {
  color: var(--txt);
}

/* ---------- page scaffold ---------- */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 40px 16px;
  box-sizing: border-box;
}

.hero-logo {
  display: block;
  width: 280px;
  max-width: 80%;
  height: auto;
}

/* ---------- card ---------- */
.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

/* uppercase display kicker: 10.5–12px, .22–.32em tracking (spec §3) */
.kicker {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--mut);
  text-align: center;
}

.card h1 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: var(--txt);
  text-align: center;
}

/* ---------- forms ---------- */
.card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
}

.card input[type="text"],
.card input[type="password"] {
  padding: 10px 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-family: var(--body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease-in-out;
}

.card input:focus {
  border-color: var(--dim);
}

.card input:focus-visible,
.neon-btn:focus-visible,
.logout:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* primary CTA: brand-streak border, fills on hover (login-big.svg treatment) */
.neon-btn {
  position: relative;
  z-index: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 4px;
  padding: 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--streak) border-box;
  color: var(--txt);
  font-family: var(--body);
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease-in-out;
}

.neon-btn::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 10px;
  background: var(--streak);
  filter: blur(14px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease-in-out;
}

.neon-btn:hover,
.neon-btn:focus-visible {
  background: var(--streak) border-box;
  color: #0A0A0A;
}

.neon-btn:hover::before,
.neon-btn:focus-visible::before {
  opacity: 0.7;
}

.error {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 11%, transparent);
  color: var(--danger);
  font-size: 13px;
  text-align: center;
}

/* ---------- admin panel: wide layout ---------- */
.admin-shell {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-header-row h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
}

.section-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--mut);
}

.back-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
  text-decoration: none;
}

.back-link:hover {
  color: var(--txt);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}

.data-table th {
  font-family: var(--display);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
  background: var(--card2);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .mono {
  font-family: var(--mono);
}

.data-table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.empty-row {
  padding: 18px 14px;
  color: var(--mut);
  font-size: 13px;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 99px;
  font-family: var(--display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pill-ok {
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent);
  background: color-mix(in srgb, var(--ok) 11%, transparent);
}

.pill-off {
  color: var(--mut);
  border: 1px solid var(--line);
  background: var(--card2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card2);
  color: var(--txt);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

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

.btn-danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.btn-danger:hover {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 11%, transparent);
}

.inline-form {
  display: inline;
}

.banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.banner-ok {
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent);
  background: color-mix(in srgb, var(--ok) 11%, transparent);
  color: var(--ok);
}

.banner-warn {
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  background: color-mix(in srgb, var(--danger) 11%, transparent);
  color: var(--danger);
}

.credential {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--card2);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--txt);
  word-break: break-all;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field-row label {
  flex: 1;
  min-width: 160px;
}

label.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dim);
}

.checkbox-row input {
  margin: 0;
}

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--mut);
}

/* spec §9: reduced motion disables glow transitions */
@media (prefers-reduced-motion: reduce) {
  .neon-btn,
  .neon-btn::before,
  .logout,
  .btn,
  .card input[type="text"],
  .card input[type="password"] {
    transition: none;
  }
}

/* ---------- directory admin (organizations & editions) ---------- */

/* The org pages carry three-column edition rows; give them more room. */
.admin-shell-wide {
  max-width: 1080px;
}

.admin-nav {
  display: flex;
  gap: 8px;
}

/* Number inputs and selects join the text-input recipe — the directory
   forms are the first admin surface to use either. */
.card input[type="number"],
.card select {
  padding: 10px 12px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--txt);
  font-family: var(--body);
  font-size: 15px;
  outline: none;
}

.card select:focus-visible,
.card input[type="number"]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

/* Compact role select inside a member table row */
.data-table .inline-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.data-table .inline-form select {
  padding: 6px 8px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--txt);
  font-family: var(--body);
  font-size: 13px;
}

/* The switcher's org accent, echoed wherever the directory names a tenant */
.org-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: baseline;
}

.org-dot-lg {
  width: 14px;
  height: 14px;
  margin-right: 8px;
}

/* One edition = one bordered sub-form inside the editions card */
.edition-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--card2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.edition-row .edition-id {
  margin: 0;
}

.edition-row input,
.edition-row select {
  background: var(--bg, #0A0A0A);
}

/* Buttons inside a field-row shouldn't stretch like the labels do */
.field-row .btn,
.field-row form {
  flex: 0 0 auto;
}
