:root {
  --brand: #0b5a41;
  --brand-dark: #073b2b;
  --brand-light: #2f7d63;
  --accent: #e3b86b;
  --ink: #0c2b23;
  --muted: #55736a;
  --subtle: #8aa29a;
  --border: #dce9e4;
  --surface: #ffffff;
  --surface-muted: #f2f7f5;
  --background: #f6faf8;
  --danger: #b83f49;
  --shadow: 0 22px 60px rgba(7, 59, 43, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 88% 8%, rgba(227, 184, 107, 0.18), transparent 24rem),
    linear-gradient(180deg, #fbfdfc 0%, var(--background) 52%, #eef6f2 100%);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.page-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(11, 90, 65, 0.1) 0.75px, transparent 0.75px);
  background-size: 20px 20px;
  mask-image: linear-gradient(to bottom, black, transparent 58%);
  opacity: 0.28;
}

.shell {
  position: relative;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--brand);
  box-shadow: 0 8px 20px rgba(11, 90, 65, 0.2);
}

.brand-mark::before {
  position: absolute;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 6px 0 rgba(255, 255, 255, 0.86), 0 12px 0 rgba(255, 255, 255, 0.7);
  content: "";
  transform: rotate(-24deg);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.service-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.77rem;
  font-weight: 650;
  backdrop-filter: blur(12px);
}

.state-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(227, 184, 107, 0.16);
}

.service-state[data-state="ready"] .state-dot {
  background: #3fa374;
  box-shadow: 0 0 0 4px rgba(63, 163, 116, 0.14);
}

.service-state[data-state="error"] .state-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(184, 63, 73, 0.12);
}

.hero {
  max-width: 760px;
  padding: 72px 0 44px;
}

.eyebrow,
.step-label {
  margin: 0 0 10px;
  color: var(--brand-light);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.99;
}

.hero-copy {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(350px, 0.85fr);
  gap: 22px;
  align-items: start;
}

.card {
  border: 1px solid rgba(220, 233, 228, 0.94);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.import-card {
  padding: 30px;
}

.result-card {
  min-height: 486px;
  padding: 30px;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 24px;
}

.card-heading h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.025em;
}

.read-only-badge,
.status-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.read-only-badge {
  padding: 7px 10px;
  color: var(--brand);
  background: #e7f3ee;
}

.status-badge {
  padding: 7px 11px;
  color: var(--muted);
  background: var(--surface-muted);
}

.status-badge[data-tone="working"] {
  color: #7b5b1d;
  background: #fff4dc;
}

.status-badge[data-tone="success"] {
  color: var(--brand);
  background: #e1f3eb;
}

.status-badge[data-tone="error"] {
  color: var(--danger);
  background: #fff0f1;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.field input,
.otp-action input {
  width: 100%;
  height: 49px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--surface-muted);
  padding: 0 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field input::placeholder,
.otp-action input::placeholder {
  color: var(--subtle);
}

.field input:focus,
.otp-action input:focus {
  border-color: var(--brand-light);
  background: white;
  box-shadow: 0 0 0 4px rgba(47, 125, 99, 0.12);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 62px;
}

.reveal-button {
  position: absolute;
  top: 50%;
  right: 11px;
  border: 0;
  color: var(--brand);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transform: translateY(-50%);
}

.field-help {
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 6px 0 20px;
  padding: 14px;
  border: 1px solid #d9ebe4;
  border-radius: 13px;
  background: #f4faf7;
}

.privacy-icon {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand-light);
  font-size: 0.72rem;
  font-weight: 900;
}

.privacy-note p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.primary-button,
.download-button {
  border: 0;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 52px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 13px;
  color: white;
  background: var(--brand);
  box-shadow: 0 12px 24px rgba(11, 90, 65, 0.2);
  font-weight: 760;
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-dark);
  box-shadow: 0 14px 28px rgba(7, 59, 43, 0.24);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.button-arrow {
  font-size: 1.12rem;
}

.otp-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid #ecd5a6;
  border-radius: 16px;
  background: #fffaf0;
}

.otp-copy h3,
.empty-state h3,
.progress-state h3,
.result-lead h3 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.otp-copy > p:last-child,
.empty-state p,
.progress-state p,
.result-lead p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.5;
}

.otp-action {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  margin-top: 16px;
}

.primary-button.compact {
  height: 49px;
}

.empty-state {
  display: flex;
  min-height: 315px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 36px 20px;
  text-align: center;
}

.empty-state p {
  max-width: 310px;
}

.score-stack {
  position: relative;
  width: 84px;
  height: 80px;
  margin-bottom: 22px;
}

.score-stack span {
  position: absolute;
  inset: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: white;
  box-shadow: 0 8px 16px rgba(12, 43, 35, 0.06);
}

.score-stack span::before,
.score-stack span::after {
  position: absolute;
  left: 12px;
  height: 3px;
  border-radius: 999px;
  background: #dce9e4;
  content: "";
}

.score-stack span::before {
  top: 17px;
  width: 27px;
}

.score-stack span::after {
  top: 27px;
  width: 35px;
}

.score-stack span:nth-child(1) {
  transform: translate(-10px, 6px) rotate(-8deg);
}

.score-stack span:nth-child(2) {
  transform: translate(9px, 4px) rotate(7deg);
}

.score-stack span:nth-child(3) {
  border-top: 4px solid var(--accent);
}

.progress-state {
  display: flex;
  min-height: 290px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 35px 18px;
}

.progress-ring {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 3px solid #e1ebe7;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

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

.message {
  margin: 0 0 18px;
  padding: 13px 14px;
  border: 1px solid #f0c8cc;
  border-radius: 12px;
  color: #7b2f36;
  background: #fff4f5;
  font-size: 0.8rem;
  line-height: 1.5;
}

.result-lead {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d5e9e1;
  border-radius: 15px;
  background: #f1faf6;
}

.complete-mark {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--border);
}

.stats div {
  padding: 15px;
  background: white;
}

.stats dt {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 650;
}

.stats dd {
  margin: 5px 0 0;
  font-size: 1.28rem;
  font-weight: 780;
  letter-spacing: -0.03em;
}

.date-range {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 18px;
  color: var(--muted);
  font-size: 0.72rem;
}

.date-range strong {
  color: var(--ink);
  font-size: 0.74rem;
}

.download-label {
  margin: 0 0 9px 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.download-button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: left;
  color: var(--ink);
  background: var(--surface-muted);
}

.download-button:hover:not(:disabled) {
  color: white;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-1px);
}

.download-button.featured {
  border-color: #e4c588;
  background: #fff9ed;
}

.download-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.download-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  background: #e7f3ee;
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
}

.download-button:hover .download-icon {
  color: var(--brand);
  background: white;
}

.download-button strong,
.download-button small {
  display: block;
}

.download-button strong {
  font-size: 0.76rem;
}

.download-button small {
  margin-top: 3px;
  opacity: 0.72;
  overflow: hidden;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secondary-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 16px;
}

.text-button {
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.text-button:hover {
  color: var(--brand);
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 28px 12px 0;
  color: var(--subtle);
  font-size: 0.68rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

@media (max-width: 880px) {
  .hero {
    padding-top: 56px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .result-card {
    min-height: 420px;
  }
}

@media (max-width: 600px) {
  .shell {
    width: min(100% - 24px, 1160px);
    padding-top: 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .service-state {
    max-width: 126px;
  }

  .hero {
    padding: 48px 4px 34px;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 14vw, 4rem);
  }

  .hero-copy {
    font-size: 0.96rem;
  }

  .card,
  .import-card,
  .result-card {
    border-radius: 19px;
  }

  .import-card,
  .result-card {
    padding: 22px;
  }

  .field-row,
  .otp-action {
    grid-template-columns: 1fr;
  }

  .otp-action .primary-button {
    width: 100%;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }
}

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