*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #00843D;
  --green-dark: #006830;
  --gold: #FFCD00;
  --text: #1a1a1a;
  --muted: #555;
  --border: #ddd;
  --bg: #f5f7f5;
  --card: #fff;
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header */
header {
  background: var(--green);
  color: #fff;
  text-align: center;
  padding: 2rem 1rem 1.5rem;
}

.logo {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.logo .tld {
  color: var(--gold);
}

.tagline {
  margin-top: 0.4rem;
  font-size: 1rem;
  opacity: 0.88;
}

/* Main */
main {
  max-width: 760px;
  margin: 2rem auto;
  padding: 0 1rem 4rem;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

textarea, input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0,132,61,0.12);
}

/* Suburb row */
.suburb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.field label {
  display: block;
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

/* Buttons */
.btn-primary, .btn-pay {
  display: block;
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  margin-top: 0.5rem;
}

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

.btn-pay {
  background: var(--gold);
  color: var(--text);
  margin-top: 1.25rem;
}

.btn-pay:hover { background: #e6b800; }

.btn-primary:active, .btn-pay:active { transform: scale(0.98); }

/* Payment card */
.price { color: var(--green); }

.payment-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

#payment-element {
  margin-bottom: 0.5rem;
}

/* Error */
.error-msg {
  color: #c0392b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

/* Loading */
.loading-state {
  text-align: center;
  padding: 4rem 1rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 5px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

/* Results page */
.result-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 1rem auto;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
}

.score-circle small {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
}

.match-level {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: var(--green-dark);
}

.result-list {
  list-style: none;
  padding: 0;
}

.result-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}

.result-list li:last-child { border-bottom: none; }

.result-list.strengths li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.result-list.gaps li::before { content: "✗ "; color: #c0392b; font-weight: 700; }

.location-note {
  background: #f0f8f3;
  border-left: 3px solid var(--green);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--muted);
}

.recommendation {
  font-size: 0.95rem;
  line-height: 1.7;
}

.btn-back {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.65rem 1.4rem;
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.btn-back:hover { background: var(--green-dark); }

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

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 540px) {
  .suburb-row { grid-template-columns: 1fr; }
  .logo { font-size: 1.9rem; }
}
