:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-muted: #faf7f1;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #7a7a7a;
  --border: #e5e0d5;
  --brand: #0b3d2e;
  --brand-hover: #0f5340;
  --accent: #c8a46a;
  --success: #14532d;
  --success-bg: #e8f3ec;
  --danger: #7a1f1f;
  --danger-bg: #fbeceb;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  min-height: 100vh;
}

.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 8px 0 18px;
  flex-wrap: nowrap;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.logo img {
  display: block;
  width: auto;
  height: auto;
  max-height: 46px;
  max-width: 100%;
  object-fit: contain;
}

.logo-sim7 img {
  max-height: 40px;
}

.logo-hs img {
  max-height: 64px;
}

.logo-green img {
  max-height: 44px;
}

.logo-divider {
  width: 1px;
  height: 42px;
  background: var(--border);
  flex: 0 0 auto;
}

.header {
  text-align: center;
  padding: 8px 0 24px;
}

.header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.subtitle {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--success-bg);
  border: 1px solid rgba(11, 61, 46, 0.12);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.intro {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 15px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field-optional {
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 6px;
  line-height: 1.4;
}

input[type="text"],
input[type="date"] {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(11, 61, 46, 0.12);
}

input::placeholder {
  color: #b4ae9f;
}

.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--brand-hover);
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1.5px solid var(--brand);
  margin-top: 18px;
}

.btn-secondary:hover {
  background: var(--brand);
  color: #ffffff;
}

.hidden {
  display: none !important;
}

/* Loading */
#loading-section {
  text-align: center;
  padding: 36px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Result card */
.result-card {
  border-top: 4px solid var(--brand);
  background: linear-gradient(180deg, var(--success-bg) 0%, var(--surface) 120px);
}

.result-eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-time {
  margin: 0 0 22px;
  font-size: 56px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result-details {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.detail dt {
  margin: 0;
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
}

.detail dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.detail-obs {
  flex-direction: column;
  align-items: flex-start;
}

.detail-obs dd {
  text-align: left;
  font-weight: 500;
  color: var(--ink-soft);
  margin-top: 4px;
}

.result-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* Choice list (multiple matches) */
.choice-title {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--ink);
  font-weight: 700;
}

.choice-help {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14px;
}

.choice-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  border-top: 1px solid var(--border);
}

.choice-item {
  border-bottom: 1px solid var(--border);
}

.choice-btn {
  width: 100%;
  background: transparent;
  border: 0;
  padding: 14px 8px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 6px;
  transition: background 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.choice-btn:hover,
.choice-btn:focus {
  background: var(--surface-muted);
  outline: none;
}

.choice-name {
  font-weight: 600;
}

.choice-meta {
  font-size: 13px;
  color: var(--ink-muted);
}

/* Error card */
.error-card {
  border-top: 4px solid var(--danger);
  background: linear-gradient(180deg, var(--danger-bg) 0%, var(--surface) 120px);
}

.error-title {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--danger);
}

.error-text {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 15px;
}

.error-support {
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
}

.error-support a {
  color: var(--brand);
  font-weight: 600;
}

/* Footer */
.footer {
  text-align: center;
  padding: 20px 0 0;
}

.footer p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
}

/* Small mobile tweaks */
@media (max-width: 380px) {
  .logos {
    gap: 10px;
  }
  .logo-sim7 img { max-height: 32px; }
  .logo-hs img { max-height: 52px; }
  .logo-green img { max-height: 36px; }
  .logo-divider { height: 34px; }
}

/* Tablet+ */
@media (min-width: 640px) {
  .container {
    padding: 40px 24px 64px;
  }
  .header h1 {
    font-size: 30px;
  }
  .card {
    padding: 28px 26px;
  }
  .result-time {
    font-size: 64px;
  }
  .logos {
    gap: 28px;
  }
  .logo-sim7 img { max-height: 46px; }
  .logo-hs img { max-height: 78px; }
  .logo-green img { max-height: 52px; }
  .logo-divider { height: 52px; }
}
