/* Styles for the tenant web interface: design tokens, console layout, light and dark theming, shadows, glow, and animations */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --border: #e3e8ef;
  --border-strong: #cbd5e1;
  --text: #0f1720;
  --text-muted: #5b6776;
  --text-faint: #98a4b3;
  --accent: #0891b2;
  --accent-strong: #06b6d4;
  --accent-glow: rgba(8, 145, 178, 0.16);
  --success: #0f9d6b;
  --error: #dc2626;
  --warn: #c2700a;
  --dot: rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.07);
  --glow-strength: 0px;
  --font: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0a0e14;
  --surface: #11161f;
  --surface-2: #161c27;
  --border: #1f2733;
  --border-strong: #2c3744;
  --text: #e6edf3;
  --text-muted: #8b97a7;
  --text-faint: #58616f;
  --accent: #22d3ee;
  --accent-strong: #67e8f9;
  --accent-glow: rgba(34, 211, 238, 0.22);
  --success: #34d399;
  --error: #f87171;
  --warn: #fbbf24;
  --dot: rgba(148, 163, 184, 0.07);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 44px rgba(0, 0, 0, 0.55);
  --glow-strength: 22px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  transition: background-image 0.4s ease;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 22px 24px;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text);
}

.brand__prompt {
  color: var(--accent);
  margin-right: 8px;
  text-shadow: 0 0 var(--glow-strength) var(--accent-glow);
}

.brand__accent {
  color: var(--accent);
  text-shadow: 0 0 var(--glow-strength) var(--accent-glow);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, background 0.4s ease;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}

.hero {
  margin: 28px 0 32px;
}

.hero__eyebrow {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
}

.hero__title {
  margin: 0 0 16px;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.hero__desc {
  margin: 0;
  max-width: 60ch;
  font-size: 15px;
  color: var(--text-muted);
}

.console {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: background 0.4s ease, border-color 0.4s ease;
}

.tabs {
  position: relative;
  display: flex;
  padding: 8px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
}

.tabs__indicator {
  position: absolute;
  top: 8px;
  left: 8px;
  height: calc(100% - 16px);
  width: calc(50% - 10px);
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.tabs__indicator[data-pos="user"] {
  transform: translateX(calc(100% + 4px));
}

.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 11px 16px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.2s ease;
}

.tab[aria-selected="true"] {
  color: var(--accent);
}

.tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form {
  display: flex;
  gap: 12px;
  padding: 20px;
}

.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.4s ease;
}

.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), 0 0 var(--glow-strength) var(--accent-glow);
}

.field__caret {
  color: var(--accent);
  font-weight: 800;
  flex-shrink: 0;
}

.field__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
}

.field__input::placeholder {
  color: var(--text-faint);
}

.check {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--accent);
  color: #04141a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.check:hover:not(:disabled) {
  transform: translateY(-2px);
  background: var(--accent-strong);
  box-shadow: 0 6px 20px var(--accent-glow), 0 0 var(--glow-strength) var(--accent-glow);
}

.check:active:not(:disabled) {
  transform: translateY(0);
}

.check:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.check:disabled {
  opacity: 0.55;
  cursor: progress;
}

.check svg {
  width: 16px;
  height: 16px;
}

.note {
  padding: 0 20px 20px;
  margin: 0;
  font-size: 13px;
  color: var(--text-faint);
}

.readout {
  margin-top: 20px;
  min-height: 72px;
}

.readout--empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--text-faint);
  font-size: 14px;
}

.readout--empty .field__caret {
  font-size: 15px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  position: relative;
  overflow: hidden;
  animation: rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.card--scan::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.8;
  animation: scan 1.1s ease-in-out infinite;
}

.card--ok {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.card--bad {
  border-color: color-mix(in srgb, var(--error) 30%, var(--border));
}

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.status__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 var(--glow-strength) currentColor;
}

.status__dot--ok {
  background: var(--success);
  color: var(--success);
  animation: pulse 2s ease-in-out infinite;
}

.status__dot--bad {
  background: var(--error);
  color: var(--error);
}

.status__dot--busy {
  background: var(--accent);
  color: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}

.status__verdict {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status__verdict--ok {
  color: var(--success);
}

.status__verdict--bad {
  color: var(--error);
}

.status__target {
  color: var(--text-muted);
  font-size: 14px;
  word-break: break-all;
}

.rows {
  margin: 18px 0 0;
  border-top: 1px solid var(--border);
}

.row {
  display: flex;
  gap: 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  animation: revealRow 0.4s ease both;
}

.row:last-child {
  border-bottom: none;
}

.row__key {
  flex-shrink: 0;
  width: 130px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.row__val {
  color: var(--text);
  word-break: break-all;
}

.row__val--accent {
  color: var(--accent);
}

.row__val--warn {
  color: var(--warn);
}

.card__note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

.dots span {
  animation: blink 1.4s infinite both;
}

.dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.dots span:nth-child(3) {
  animation-delay: 0.4s;
}

.footer {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 36px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-faint);
}

.footer__link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer__link:hover {
  color: var(--accent);
}

.footer__sep {
  color: var(--border-strong);
}

.load-rise {
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.load-rise:nth-child(2) {
  animation-delay: 0.06s;
}

.load-rise:nth-child(3) {
  animation-delay: 0.12s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealRow {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 var(--glow-strength) currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 calc(var(--glow-strength) + 6px) currentColor;
    opacity: 0.75;
  }
}

@keyframes blink {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 1;
  }
}

@keyframes scan {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}

@media (max-width: 560px) {
  .form {
    flex-direction: column;
  }

  .check {
    justify-content: center;
  }

  .row {
    flex-direction: column;
    gap: 4px;
  }

  .row__key {
    width: auto;
  }
}

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