:root {
  color-scheme: dark;
  --red: #e60c16;
  --red-dark: #a7080e;
  --ink: #f8fafc;
  --muted: #aeb5c2;
  --surface: #151515;
  --surface-soft: #202020;
  --line: rgba(255, 255, 255, 0.12);
  --success: #25b86b;
  --warning: #f4b942;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(230, 12, 22, 0.35), transparent 38rem),
    #080808;
  color: var(--ink);
  font-family: "Montserrat", system-ui, sans-serif;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.tnt-eyebrow {
  color: var(--red);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tnt-login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(20rem, 1fr) minmax(22rem, 34rem);
}

.tnt-login__brand {
  display: grid;
  place-content: center;
  justify-items: center;
  background: linear-gradient(135deg, rgba(230, 12, 22, 0.9), rgba(90, 6, 10, 0.92));
  text-align: center;
}

.tnt-login__brand img { width: min(18rem, 52%); filter: drop-shadow(0 1rem 2rem rgba(0, 0, 0, 0.35)); }
.tnt-login__brand p { margin: 1.25rem 0 0; font-family: "Barlow Condensed"; font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 900; line-height: 0.8; }
.tnt-login__brand span { margin-top: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; }

.tnt-login__card {
  align-self: center;
  width: min(100% - 2rem, 28rem);
  margin: auto;
  padding: clamp(1.5rem, 5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  background: rgba(21, 21, 21, 0.9);
  box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.35);
}

.tnt-login__card h1, .tnt-panel h1, .tnt-dialog h2 {
  margin: 0.45rem 0 0.75rem;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  line-height: 0.95;
}

.tnt-login__card h1 { font-size: 2.5rem; }
.tnt-login__card p { color: var(--muted); line-height: 1.6; }
.tnt-login__card label, .tnt-dialog label { display: block; margin: 1rem 0 0.4rem; color: #d6d9df; font-size: 0.84rem; font-weight: 700; }
.tnt-login__card input, .tnt-dialog input, .tnt-dialog select {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  outline: none;
  background: #0d0d0d;
  color: var(--ink);
}
.tnt-login__card input:focus, .tnt-dialog input:focus, .tnt-dialog select:focus, .tnt-code-form input:focus { border-color: var(--red); box-shadow: 0 0 0 0.2rem rgba(230, 12, 22, 0.18); }
.tnt-form-message { min-height: 1.4rem; color: #ff8188 !important; font-size: 0.86rem; }

.tnt-button {
  min-height: 3rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  color: #fff;
  font-weight: 800;
  transition: transform 150ms ease, filter 150ms ease;
}
.tnt-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.tnt-button:disabled { cursor: wait; filter: grayscale(0.6); opacity: 0.65; transform: none; }
.tnt-button--primary { background: var(--red); }
.tnt-button--success { background: var(--success); }
.tnt-button--secondary { border-color: var(--line); background: transparent; }
.tnt-button--danger { background: var(--red-dark); }
.tnt-login__card .tnt-button { width: 100%; margin-top: 0.5rem; }

.tnt-kiosk { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.tnt-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.82);
  backdrop-filter: blur(14px);
}
.tnt-header .tnt-clock {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.tnt-brand { display: flex; align-items: center; gap: 0.85rem; }
.tnt-brand img { width: 3.4rem; height: 3.4rem; object-fit: contain; }
.tnt-brand span, .tnt-brand strong, .tnt-brand small { display: block; }
.tnt-brand strong { font-family: "Barlow Condensed"; font-size: 1.35rem; font-weight: 900; line-height: 1; }
.tnt-brand small { margin-top: 0.15rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tnt-icon-button { width: 2.8rem; height: 2.8rem; border: 1px solid var(--line); border-radius: 50%; background: rgba(255, 255, 255, 0.05); color: var(--muted); font-size: 1.2rem; }

.tnt-stage { display: grid; place-items: center; width: min(100% - 2rem, 80rem); min-height: 0; margin: auto; padding: clamp(0.75rem, 2vw, 1.5rem) 0; }
.tnt-panel {
  width: min(100%, 56rem);
  padding: clamp(1.5rem, 5vw, 4.5rem);
  border: 1px solid var(--line);
  border-radius: clamp(1rem, 3vw, 2rem);
  background: linear-gradient(145deg, rgba(30, 30, 30, 0.97), rgba(15, 15, 15, 0.97));
  box-shadow: 0 2rem 6rem rgba(0, 0, 0, 0.4);
  text-align: center;
}
.tnt-panel h1 { font-size: clamp(3rem, 8vw, 6.2rem); letter-spacing: -0.02em; }
.tnt-welcome-gym {
  display: block;
  margin: 0.1rem 0 0.35rem;
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 900;
  font-size: clamp(2.75rem, 7vw, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}
.tnt-panel--welcome #welcome-title { font-size: clamp(1.35rem, 3vw, 2.2rem); color: var(--muted); }
.tnt-panel > p { max-width: 43rem; margin: 0 auto; color: var(--muted); font-size: clamp(1rem, 2.2vw, 1.35rem); line-height: 1.55; }
.tnt-scan-icon, .tnt-result-icon {
  display: grid;
  place-items: center;
  width: clamp(4.25rem, 9vw, 5.75rem);
  height: clamp(4.25rem, 9vw, 5.75rem);
  margin: 0 auto 1.5rem;
  border-radius: 1.5rem;
  background: rgba(230, 12, 22, 0.13);
  color: var(--red);
  font-size: clamp(2rem, 4.5vw, 3rem);
  box-shadow: inset 0 0 0 1px rgba(230, 12, 22, 0.28);
}
.tnt-code-form { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; max-width: 38rem; margin: 2rem auto 0; }
.tnt-code-form input {
  min-width: 0;
  min-height: 4rem;
  padding: 0 1.25rem;
  border: 2px solid var(--line);
  border-radius: 0.9rem;
  outline: none;
  background: #080808;
  color: #fff;
  font-size: 1.15rem;
  text-align: center;
}
.tnt-code-form .tnt-button { min-height: 4rem; display: flex; align-items: center; gap: 0.7rem; }
.tnt-help { min-height: 1.5rem; margin-top: 1rem !important; font-size: 0.92rem !important; }

.tnt-panel--result,
.tnt-panel--decision {
  width: 100%;
  min-height: min(40rem, calc(100dvh - 9rem));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(0.6rem, 1.4vh, 1rem);
  padding: clamp(1rem, 2.2vw, 1.9rem);
}
.tnt-panel--result:focus,
.tnt-panel--decision:focus { outline: none; }
.tnt-panel--result h1,
.tnt-feedback-member strong {
  max-width: 100%;
  margin: 0.35rem auto 0;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.tnt-member-portrait {
  display: grid;
  place-items: center;
  width: clamp(9.5rem, 15vw, 12rem);
  height: clamp(9.5rem, 15vw, 12rem);
  margin: 0 auto;
  overflow: hidden;
  border: 0.3rem solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: linear-gradient(145deg, #2c2c2c, #111);
  color: #fff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(3.2rem, 6.5vw, 4.8rem);
  font-weight: 900;
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.5);
}
.tnt-member-portrait img { width: 100%; height: 100%; object-fit: cover; }
.tnt-member-identity { width: min(100%, 64rem); text-align: center; }
.tnt-feedback-member strong { display: block; }
.tnt-clock {
  color: rgba(255, 255, 255, 0.85);
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}
.tnt-member-details {
  display: grid;
  width: min(100%, 26rem);
  margin: 0.85rem auto 0;
  text-align: left;
}
.tnt-member-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.15rem;
  border-bottom: 1px solid var(--line);
}
.tnt-member-details > div:first-child { border-top: 1px solid var(--line); }
.tnt-member-details dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tnt-member-details dd {
  margin: 0;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: right;
}
.tnt-decision-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 1.6vw, 1.1rem);
  width: min(100%, 52rem);
  padding: clamp(0.85rem, 1.8vw, 1.2rem);
  border: 2px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
}
.tnt-panel--result .tnt-decision-banner > i {
  flex: 0 0 auto;
  color: var(--warning);
  font-size: clamp(1.8rem, 3.6vw, 2.8rem);
}
.tnt-decision-banner .tnt-result-icon { flex: 0 0 auto; margin: 0; }
.tnt-decision-copy { min-width: 0; text-align: left; }
.tnt-decision-copy h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 0.95;
}
.tnt-decision-copy p,
.tnt-result-copy {
  margin: 0.4rem 0 0;
  color: #fff;
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 700;
  line-height: 1.4;
}
.tnt-staff-actions { max-width: 38rem; margin: 2rem auto 0; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.tnt-staff-actions > span { display: block; margin-bottom: 0.8rem; color: var(--muted); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.tnt-staff-actions > div { display: flex; justify-content: center; gap: 0.75rem; }
.tnt-link-button { margin-top: 1.25rem; border: 0; background: transparent; color: var(--muted); text-decoration: underline; }
.tnt-member-help { margin-top: 0 !important; font-size: 0.9rem !important; }
.tnt-member-help i { margin-right: 0.35rem; color: var(--red); }
.tnt-operator-member { margin: 1rem 0 0.5rem; color: var(--ink); font-weight: 800; }
#operator-check-in { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: 0.8rem; background: rgba(255, 255, 255, 0.04); }
#operator-check-in .tnt-button { width: 100%; }
.tnt-dialog-copy { color: var(--muted); line-height: 1.5; }
#reception-auth-button { width: 100%; }
.tnt-panel--status h1 { font-size: clamp(2.7rem, 7vw, 4.8rem); }
.tnt-feedback-member {
  display: grid;
  justify-items: center;
  gap: clamp(0.85rem, 1.8vh, 1.35rem);
  width: 100%;
}
#feedback-reset { margin-top: 0.25rem; }
.tnt-spinner { width: 5.5rem; height: 5.5rem; margin: 0 auto 2rem; border: 0.55rem solid rgba(255, 255, 255, 0.12); border-top-color: var(--red); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-success {
  border-color: rgba(37, 184, 107, 0.75);
  box-shadow: 0 0 0 1px rgba(37, 184, 107, 0.12), 0 2rem 6rem rgba(10, 110, 58, 0.25);
}
.is-error {
  border-color: rgba(230, 12, 22, 0.75);
  box-shadow: 0 0 0 1px rgba(230, 12, 22, 0.12), 0 2rem 6rem rgba(130, 0, 7, 0.25);
}
.is-warning {
  border-color: rgba(244, 185, 66, 0.7);
  box-shadow: 0 0 0 1px rgba(244, 185, 66, 0.1), 0 2rem 6rem rgba(110, 75, 0, 0.2);
}
.is-success .tnt-member-portrait { border-color: var(--success); box-shadow: 0 0 0 0.45rem rgba(37, 184, 107, 0.12), 0 1.5rem 4rem rgba(0, 0, 0, 0.5); }
.is-error .tnt-member-portrait { border-color: var(--red); box-shadow: 0 0 0 0.45rem rgba(230, 12, 22, 0.12), 0 1.5rem 4rem rgba(0, 0, 0, 0.5); }
.is-warning .tnt-member-portrait { border-color: var(--warning); box-shadow: 0 0 0 0.45rem rgba(244, 185, 66, 0.12), 0 1.5rem 4rem rgba(0, 0, 0, 0.5); }
.is-success .tnt-decision-banner { border-color: rgba(37, 184, 107, 0.6); background: rgba(37, 184, 107, 0.12); }
.is-error .tnt-decision-banner { border-color: rgba(230, 12, 22, 0.6); background: rgba(230, 12, 22, 0.12); }
.is-warning .tnt-decision-banner { border-color: rgba(244, 185, 66, 0.6); background: rgba(244, 185, 66, 0.1); }
.is-success .tnt-result-icon { background: var(--success); color: #04160d; box-shadow: 0 0 0 0.45rem rgba(37, 184, 107, 0.14); }
.is-error .tnt-result-icon { background: var(--red); color: #fff; box-shadow: 0 0 0 0.45rem rgba(230, 12, 22, 0.14); }
.is-warning .tnt-result-icon { background: var(--warning); color: #1c1300; box-shadow: 0 0 0 0.45rem rgba(244, 185, 66, 0.14); }
.tnt-footer { padding: 0.8rem; color: #737985; font-family: "Barlow Condensed"; font-size: 0.85rem; font-weight: 800; letter-spacing: 0.14em; text-align: center; text-transform: uppercase; }

.tnt-dialog { width: min(100% - 2rem, 34rem); padding: 0; border: 1px solid var(--line); border-radius: 1.25rem; background: #141414; color: var(--ink); }
.tnt-dialog::backdrop { background: rgba(0, 0, 0, 0.75); backdrop-filter: blur(4px); }
.tnt-dialog__card { padding: 1.4rem; }
.tnt-dialog header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.tnt-dialog h2 { font-size: 2rem; }
.tnt-dialog small { display: block; margin-top: 0.45rem; color: var(--muted); line-height: 1.45; }
.tnt-dialog details { margin-top: 1.25rem; padding: 0.9rem; border: 1px solid var(--line); border-radius: 0.75rem; color: var(--muted); }
.tnt-dialog summary { cursor: pointer; font-size: 0.86rem; font-weight: 700; }
.tnt-dialog__actions { display: flex; justify-content: space-between; gap: 0.75rem; margin-top: 1.5rem; }
#debt-controls { margin-top: 1.25rem; padding: 1rem; border: 1px solid rgba(244, 185, 66, 0.35); border-radius: 0.8rem; background: rgba(244, 185, 66, 0.08); }
#debt-controls .tnt-button { width: 100%; margin-top: 0.8rem; }

@media (max-width: 760px) {
  .tnt-login { grid-template-columns: 1fr; }
  .tnt-login__brand { display: none; }
  .tnt-code-form { grid-template-columns: 1fr; }
  .tnt-code-form .tnt-button { justify-content: center; }
  .tnt-staff-actions > div, .tnt-dialog__actions { flex-direction: column; }
  .tnt-staff-actions .tnt-button, .tnt-dialog__actions .tnt-button { width: 100%; }
  .tnt-panel--result,
  .tnt-panel--decision { min-height: calc(100dvh - 8rem); }
  .tnt-member-portrait {
    width: clamp(9.5rem, 46vw, 13rem);
    height: clamp(9.5rem, 46vw, 13rem);
    font-size: clamp(3.5rem, 18vw, 5.5rem);
  }
  .tnt-decision-banner { text-align: left; }
}

@media (max-width: 420px) {
  .tnt-header { padding: 0.65rem 0.75rem; }
  .tnt-stage { width: min(100% - 0.75rem, 72rem); padding: 0.4rem 0; }
  .tnt-panel { padding: 1.15rem 0.8rem; }
  .tnt-panel--result h1,
  .tnt-feedback-member strong { font-size: clamp(2.4rem, 13vw, 3.4rem); }
  .tnt-brand img { width: 2.8rem; height: 2.8rem; }
  .tnt-decision-banner { gap: 0.75rem; padding: 0.9rem; }
  .tnt-decision-copy h1 { font-size: clamp(2rem, 11vw, 2.8rem); }
  .tnt-decision-copy p,
  .tnt-result-copy { font-size: 0.95rem; }
  .tnt-result-icon {
    width: 4.25rem;
    height: 4.25rem;
    margin: 0;
    border-radius: 1.25rem;
    font-size: 2rem;
  }
  .tnt-member-details { margin-top: 0.7rem; }
  .tnt-member-details > div { padding: 0.45rem 0.1rem; }
  .tnt-member-details dd { font-size: 0.95rem; }
  .tnt-member-help { display: none; }
  .tnt-footer { padding: 0.45rem; font-size: 0.72rem; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .tnt-panel--result,
  .tnt-panel--decision.has-identity { grid-template-columns: minmax(12rem, 0.75fr) minmax(18rem, 1.25fr); min-height: auto; }
  .tnt-panel--result > .tnt-member-portrait,
  .tnt-panel--decision.has-identity > .tnt-feedback-member { grid-column: 1; grid-row: 1 / span 2; }
  .tnt-panel--decision.has-identity > .tnt-decision-banner,
  .tnt-panel--decision.has-identity > #feedback-reset { grid-column: 2; }
  .tnt-panel--result > :not(.tnt-member-portrait) { grid-column: 2; }
  .tnt-member-portrait { width: clamp(12rem, 25vh, 15rem); height: clamp(12rem, 25vh, 15rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
