:root {
  --tm-navy: #003b5c;
  --tm-navy-deep: #002a42;
  --tm-accent: #0ea5e9;
  --tm-card: rgba(255, 255, 255, 0.98);
  --tm-muted: #64748b;
  --tm-radius: 1rem;
  --tm-shadow: 0 25px 50px -12px rgba(0, 59, 92, 0.35);
  font-family:
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #0f172a;
  background: linear-gradient(145deg, var(--tm-navy-deep) 0%, var(--tm-navy) 45%, #0c4a6e 100%);
}

body.tm-light {
  background: linear-gradient(160deg, #f0f9ff 0%, #e2e8f0 50%, #f8fafc 100%);
  color: #0f172a;
}

.tm-bg-pattern {
  position: fixed;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

.tm-splash {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 100;
  background: var(--tm-navy);
}

.tm-splash .tm-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tm-spin 0.75s linear infinite;
}

@keyframes tm-spin {
  to {
    transform: rotate(360deg);
  }
}

.tm-shell {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tm-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tm-brand img {
  max-height: 3.5rem;
  max-width: 8rem;
  object-fit: contain;
}

.tm-brand .tm-wordmark {
  max-height: 2.25rem;
  opacity: 0.95;
}

.tm-card {
  background: var(--tm-card);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
  padding: 1.75rem 1.5rem;
  backdrop-filter: blur(12px);
}

.tm-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tm-navy);
}

.tm-card .tm-lead {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--tm-muted);
  line-height: 1.5;
}

.tm-field {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

.tm-field input,
.tm-field textarea,
.tm-field select {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  font-size: 1rem;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.tm-field input:focus,
.tm-field textarea:focus {
  outline: none;
  border-color: var(--tm-accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.tm-btn {
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 0.65rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, var(--tm-navy) 0%, var(--tm-navy-deep) 100%);
  color: #fff;
  transition: transform 0.1s, opacity 0.15s;
}

.tm-btn:hover {
  opacity: 0.95;
}

.tm-btn:active {
  transform: scale(0.98);
}

.tm-btn-secondary {
  background: #f1f5f9;
  color: var(--tm-navy);
}

.tm-msg {
  margin-top: 1rem;
  font-size: 0.9rem;
  text-align: center;
  color: var(--tm-muted);
}

.tm-msg.tm-error {
  color: #b91c1c;
}

.tm-msg.tm-success {
  color: #047857;
}

.tm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 40, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.tm-modal-backdrop.tm-open {
  display: flex;
}

.tm-modal {
  width: 100%;
  max-width: 22rem;
  background: var(--tm-card);
  border-radius: var(--tm-radius);
  box-shadow: var(--tm-shadow);
  padding: 1.75rem 1.5rem;
  animation: tm-modal-in 0.25s ease-out;
}

@keyframes tm-modal-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tm-modal h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--tm-navy);
}

.tm-modal p {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--tm-muted);
  line-height: 1.45;
}

.tm-closed {
  text-align: center;
  padding: 2rem 1rem;
}

.tm-closed h2 {
  color: var(--tm-navy);
}

.tm-question {
  margin-bottom: 1.25rem;
}

.tm-question label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.tm-hidden {
  display: none !important;
}
