/* ── Variables & Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #FAFAFA;
  --text: #111;
  --text-secondary: #555;
  --text-tertiary: #999;
  --border: #E0E0E0;
  --border-light: #EBEBEB;
  --accent: #111;
  --card-bg: #FFFFFF;
  --yes: #1a7a3a;
  --yes-bg: #f0f9f2;
  --yes-border: #c8e6cd;
  --no: #c43333;
  --no-bg: #fdf2f2;
  --no-border: #f0c8c8;
  --refer: #946b00;
  --refer-bg: #fdf8ec;
  --refer-border: #e8d9a8;
  --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --error: #c43333;
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Desktop-only gate ── */
.desktop-gate { display: none; }

html.desktop-blocked .desktop-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
}

html.desktop-blocked .desktop-gate h1 {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
}

html.desktop-blocked #auth,
html.desktop-blocked #space,
html.desktop-blocked .menu-wrap {
  display: none !important;
}

/* ── Menu ── */
.menu-wrap {
  position: absolute;
  top: 20px;
  right: 24px;
  z-index: 100;
}

.menu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}

.menu-trigger:hover {
  color: var(--text-secondary);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: -8px;
  padding: 4px 0;
  background: var(--bg);
}

.menu-item {
  display: block;
  white-space: nowrap;
  padding: 10px 0;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: right;
  text-decoration: none;
  transition: color 0.15s;
  width: 100%;
}

.menu-item:hover {
  color: var(--text-secondary);
}

.menu-divider {
  display: none;
}

.menu-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-tertiary);
  text-align: right;
  padding: 0;
  white-space: nowrap;
  margin-bottom: 4px;
  opacity: 0.5;
}

/* ── Lenders Overlay ── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
}

.overlay-close {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s;
}

.overlay-close:hover {
  color: var(--text);
}

.lenders-modal {
  width: 100%;
  max-width: 640px;
  padding: 0 32px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.lenders-tabs {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding-top: 48px;
  padding-bottom: 32px;
  flex-shrink: 0;
}

.lenders-tab {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.lenders-tab:hover {
  color: var(--text-secondary);
}

.lenders-tab.active {
  color: var(--text);
}

.lenders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

.lenders-grid-cell {
  display: flex;
  justify-content: center;
  padding: 12px 0;
}

.lenders-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.15s;
}

.lenders-card:hover {
  opacity: 0.75;
}

.lenders-card-logo {
  height: 24px;
  max-width: 72px;
  width: auto;
  object-fit: contain;
}

.lenders-card-name {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.3;
}


/* ── Report Overlay ── */
.report-modal {
  width: 100%;
  max-width: 480px;
  padding: 0 32px;
  margin-top: auto;
  margin-bottom: auto;
}

.report-heading {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 20px;
}

.report-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 28px;
}

.report-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.report-company {
  font-size: 12px;
  color: var(--text-tertiary);
}

.report-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  outline: none;
  resize: none;
  padding: 14px 16px;
  line-height: 1.7;
  transition: border-color 0.15s;
}

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

.report-input::placeholder {
  color: var(--text-tertiary);
}

.report-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.report-hint {
  font-size: 12px;
  color: var(--error);
  opacity: 0;
  transition: opacity 0.2s;
}

.report-hint.visible {
  opacity: 1;
}

.report-submit {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.report-submit:hover:not(:disabled) {
  color: var(--text-secondary);
}

.report-submit:disabled {
  opacity: 0.3;
  cursor: default;
}

.lenders-loading {
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  display: block;
  grid-column: 1 / -1;
}

/* ── The Space ── */
.space {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: all var(--transition);
}

/* ── Empty State ── */
.input-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 45vh;
  transition: padding-top var(--transition);
}

.space.has-results .input-area {
  padding-top: 48px;
}

.input-wrapper {
  width: 100%;
  max-width: 600px;
  padding: 0 32px;
  position: relative;
}

.input-field {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.015em;
  color: var(--text);
  background: transparent;
  border: none;
  padding: 16px 0;
  outline: none;
  text-align: center;
  caret-color: transparent;
  transition: all var(--transition);
}

.input-field.typing {
  caret-color: var(--text);
}

.input-field::placeholder {
  color: var(--text-tertiary);
  font-weight: 300;
}

.space.has-results .input-field {
  font-size: 15px;
  text-align: left;
  color: var(--text-secondary);
  padding: 10px 0;
}

/* Subtle underline animation on empty state */
.input-underline {
  width: 0;
  height: 1.5px;
  background: var(--border);
  margin: 0 auto;
  transition: width 0.3s ease, height var(--transition), background var(--transition), margin var(--transition);
}

.input-field:focus ~ .input-underline {
  width: 100%;
}

.space.has-results .input-underline {
  width: 100%;
  height: 0.5px;
  background: var(--border-light);
  margin: 0;
}

/* ── Pulse (loading) ── */
.pulse-container {
  display: none;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s ease;
}

.pulse-container.active {
  display: flex;
}

.pulse-point {
  width: 0;
  height: 0;
  position: relative;
}

.pulse-point .ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  animation: thump 2.8s cubic-bezier(0.11, 0, 0.5, 0) forwards;
}

@keyframes thump {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.08);
  }
  3% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.5);
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.05);
  }
  80% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 140px rgba(0, 0, 0, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 140px rgba(0, 0, 0, 0);
  }
}

/* ── Display Title ── */
.display-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 36px;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 40px;
  padding: 0 32px;
  width: 100%;
  max-width: 880px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.display-title.visible {
  opacity: 1;
}

/* ── Results Container ── */
.results {
  width: 100%;
  max-width: 880px;
  padding: 0 32px;
  margin-top: 28px;
  padding-bottom: 80px;
  opacity: 0;
  transition: opacity 0.4s ease 0.1s;
}

.results.visible {
  opacity: 1;
}

/* ── Guide State ── */
.guide {
  max-width: 600px;
  text-align: center;
  padding: 0 32px;
  padding-left: 20px;
  margin: calc(50vh - 180px) auto 0;
  border-left: 2px solid #c44;
}

.guide-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.guide-text .guide-example-inline {
  color: inherit;
  font-weight: inherit;
}

/* ── Hidden ── */
.hidden { display: none !important; }
