:root {
  --navy: #0a2540;
  --navy-light: #14355e;
  --blue-accent: #2a6ee0;
  --white: #ffffff;
  --off-white: #f5f7fa;
  --border: #dde3ec;
  --text-primary: #172433;
  --text-secondary: #5b6b7f;
  --success: #1e8e5a;
  --error: #c0392b;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(10, 37, 64, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy) 220px, var(--off-white) 220px);
  color: var(--text-primary);
  min-height: 100vh;
}

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.header {
  padding: 40px 0 32px;
  text-align: center;
  color: var(--white);
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  margin: 8px 0 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  border: 1px solid var(--border);
}

@media (max-width: 480px) {
  .card {
    padding: 24px 20px;
  }
}

.hidden {
  display: none !important;
}

.field-group {
  margin-bottom: 24px;
}

.field-group.hidden {
  display: none;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.source-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.source-option {
  flex: 1 1 100px;
  position: relative;
  cursor: pointer;
}

.source-option input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.source-option span {
  display: block;
  text-align: center;
  padding: 12px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.source-option input:checked + span {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.source-option input:focus-visible + span {
  outline: 2px solid var(--blue-accent);
  outline-offset: 2px;
}

input[type='text'] {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  transition: border-color 0.15s ease;
}

input[type='text']:focus {
  outline: none;
  border-color: var(--blue-accent);
}

input[type='text']::placeholder {
  color: #a3aebd;
}

.helper-text {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.input-error {
  margin: 0;
  font-size: 13px;
  color: var(--error);
  font-weight: 500;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}

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

.btn-secondary {
  background: var(--off-white);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: #ebeff4;
}

.action-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.state-panel {
  text-align: center;
  padding: 12px 0;
}

.state-panel.hidden {
  display: none;
}

.state-title {
  font-size: 19px;
  font-weight: 700;
  margin: 4px 0 6px;
}

.state-subtext {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 8px auto 20px;
  border: 3px solid var(--border);
  border-top-color: var(--blue-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.result-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.result-icon.success {
  background: #e5f5ee;
  color: var(--success);
}

.result-icon.error {
  background: #fbeae8;
  color: var(--error);
}

.quote-details {
  margin: 24px 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-align: left;
}

.quote-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

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

.quote-label {
  color: var(--text-secondary);
}

.quote-value {
  font-weight: 600;
  text-align: right;
}

.quote-row.highlight {
  background: var(--off-white);
}

.quote-row.highlight .quote-value {
  color: var(--navy);
  font-size: 17px;
}

.quote-row.savings .quote-value {
  color: var(--success);
}

.fuzzy-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #f2d98a;
  border-radius: 8px;
  font-size: 13px;
  color: #8a6a1f;
  text-align: left;
}

.fuzzy-note.hidden {
  display: none;
}

.footer {
  text-align: center;
  margin-top: 24px;
}

.footer p {
  font-size: 12px;
  color: var(--text-secondary);
}
