* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f7fafc;
}

a {
  color: #2563eb;
  text-decoration: none;
}

header {
  background: linear-gradient(180deg, #0f172a 0%, #111827 52%, #0f172a 100%);
  color: white;
  padding: 2rem 1.5rem 0;
}

.hero-wrapper {
  background: #0f172a;
  padding: 2rem 1.5rem 3.5rem;
  color: white;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

nav .brand {
  font-size: 1.25rem;
  font-weight: 700;
}

nav .nav-links {
  display: flex;
  gap: 1.25rem;
  font-size: 0.95rem;
  align-items: center;
}

nav .nav-links a:not(.nav-apply) {
  color: #cbd5e1;
}

main.hero {
  max-width: 1200px;
  margin: 2rem auto 0;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.6fr 1.1fr;
  align-items: center;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 1.05;
  margin: 0;
  color: #f8fafc;
}

.hero-copy p {
  margin: 1.25rem 0 0;
  max-width: 42rem;
  line-height: 1.8;
  color: #cbd5e1;
}

.hero-copy .hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button-primary {
  background: #38bdf8;
  color: #0f172a;
}

.button-secondary {
  background: transparent;
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.55);
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  display: block;
  border-radius: 1.5rem;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.25);
}

.section {
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
}

.card h3 {
  margin-top: 0;
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #0ea5e9;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: underline;
}

.workflow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.step {
  background: #111827;
  border-radius: 1.25rem;
  padding: 1.75rem;
  color: white;
}

.step-number {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #38bdf8;
  font-weight: 700;
  margin-bottom: 1rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

footer {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #64748b;
}

.upload-card {
  background: white;
  padding: 2.5rem;
  border-radius: 1.5rem;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  max-width: 820px;
  margin: 0 auto;
}

.upload-card h2 {
  margin-top: 0;
  margin-bottom: 1.75rem;
  font-size: 1.5rem;
}

.drop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.drop-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 2.5rem 1.5rem;
  border: 2px dashed #cbd5e1;
  border-radius: 1.1rem;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  text-align: center;
  min-height: 200px;
}

.drop-zone:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
}

.drop-zone.drag-over {
  border-color: #0ea5e9;
  background: #e0f2fe;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.15);
}

.drop-zone.has-file {
  border-color: #34d399;
  background: #f0fdf4;
}

.drop-zone.drop-error {
  border-color: #f87171;
  background: #fef2f2;
}

.drop-zone input[type=file] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.drop-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: #94a3b8;
  margin-bottom: 0.25rem;
  transition: color 0.2s;
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
  color: #0ea5e9;
}

.drop-zone.has-file .drop-icon {
  color: #10b981;
}

.drop-icon svg {
  width: 100%;
  height: 100%;
}

.drop-label {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
  margin: 0;
}

.drop-hint {
  font-size: 0.83rem;
  color: #64748b;
  margin: 0;
}

.drop-browse {
  color: #0ea5e9;
  text-decoration: underline;
  cursor: pointer;
}

.drop-filename {
  font-size: 0.8rem;
  color: #059669;
  font-weight: 600;
  margin: 0.25rem 0 0;
  word-break: break-all;
  max-width: 100%;
}

.submit-btn {
  margin-top: 1.75rem;
  width: 100%;
  opacity: 1;
  transition: opacity 0.2s;
}

.submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.submit-btn.loading {
  position: relative;
  pointer-events: none;
}

@media (max-width: 600px) {
  .drop-grid {
    grid-template-columns: 1fr;
  }
}

.flash {
  background: #fef3c7;
  color: #92400e;
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.result-page {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.result-card {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.08);
}

.result-card h1 {
  margin-top: 0;
}

.result-card ul {
  padding-left: 1.2rem;
}

.result-card li {
  margin-bottom: 0.55rem;
}

@media (max-width: 900px) {
  main.hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  nav {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  nav .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    font-size: 0.88rem;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-copy .hero-actions {
    justify-content: center;
  }
}

.compliance-letter {
  margin-top: 2rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
}

.compliance-letter h2 {
  color: #92400e;
  margin-top: 0;
}

.compliance-letter pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #1f2937;
  margin: 0;
}

.noncompliant-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.5rem;
}

.noncompliant-item {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 0.75rem 1rem;
}

.noncompliant-item p {
  margin: 0.2rem 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.noncompliant-item p strong {
  color: #991b1b;
  min-width: 100px;
  display: inline-block;
}

.quick-tips {
  margin-top: 2rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 0.75rem;
  padding: 1.5rem 2rem;
}

.quick-tips h2 {
  color: #166534;
  margin-top: 0;
}

.quick-tips ul {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.quick-tips li {
  font-size: 0.93rem;
  line-height: 1.55;
  color: #14532d;
}

.hoa-name-badge {
  display: inline-block;
  background: #0f172a;
  color: #38bdf8;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: 2rem;
  margin: 0 0 1rem;
}

.compliance-letter.approval {
  background: #f0fdf4;
  border-color: #86efac;
}

.compliance-letter.approval h2 {
  color: #166534;
}

.membership-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 1.25rem;
}

.membership-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.member-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 1.1rem;
  background: #f8fafc;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.member-btn:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1);
}

.member-icon {
  font-size: 2rem;
}

@media (max-width: 500px) {
  .membership-btns {
    grid-template-columns: 1fr;
  }
}

.donate-card {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border-radius: 1.5rem;
  padding: 2.5rem;
  text-align: center;
  color: white;
  max-width: 600px;
  margin: 0 auto;
}

.donate-label {
  text-transform: uppercase;
  letter-spacing: .2em;
  color: #38bdf8;
  font-weight: 700;
  font-size: 0.75rem;
  margin: 0 0 0.75rem;
}

.donate-card h2 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.donate-card p {
  color: #94a3b8;
  line-height: 1.7;
  margin: 0 0 1.75rem;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.button-venmo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #008CFF;
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9rem 2rem;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.button-venmo:hover {
  background: #0070cc;
  transform: translateY(-1px);
  color: white;
}

.footer-links {
  margin: 0.4rem 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.88rem;
}

.footer-links a {
  color: #94a3b8;
}

.disclaimer {
  max-width: 680px;
  margin: 1rem auto 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.6;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.nav-apply {
  background: #38bdf8;
  color: #0f172a !important;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 700;
}

.apply-label {
  display: block;
  font-weight: 600;
  margin: 1.25rem 0 0.4rem;
  color: #1e293b;
}

.apply-select {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.95rem;
  color: #1e293b;
  appearance: none;
  cursor: pointer;
}

.apply-textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
}

.checklist-section {
  margin-top: 1.75rem;
}

.checklist-section h2 {
  margin-bottom: 0.75rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.checklist li {
  padding: 0.65rem 0.9rem 0.65rem 2.5rem;
  background: #f8fafc;
  border-radius: 0.6rem;
  border-left: 3px solid #38bdf8;
  position: relative;
  font-size: 0.92rem;
  line-height: 1.5;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0.75rem;
  color: #38bdf8;
  font-weight: 700;
}

.rules-section .checklist li {
  border-left-color: #818cf8;
}

.rules-section .checklist li::before {
  color: #818cf8;
  content: "§";
}

.mistakes-section .checklist li {
  border-left-color: #f87171;
  background: #fef2f2;
}

.mistakes-section .checklist li::before {
  content: "✗";
  color: #ef4444;
}

.generate-pdf-card {
  margin-top: 2.5rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 1rem;
  padding: 1.75rem 2rem;
}

.generate-pdf-card h2 {
  margin-top: 0;
  color: #0369a1;
}

.generate-pdf-card p {
  color: #475569;
  margin-bottom: 1.25rem;
}

.pdf-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.pdf-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.pdf-field--full {
  grid-column: 1 / -1;
}

.pdf-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.pdf-field input,
.pdf-field textarea {
  padding: 0.7rem 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background: white;
  font-size: 0.92rem;
  font-family: inherit;
  color: #1e293b;
}

.pdf-field textarea {
  resize: vertical;
}

@media (max-width: 600px) {
  .pdf-fields {
    grid-template-columns: 1fr;
  }
}

/* ── Toast notification ───────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(-200px);
  opacity: 0;
  pointer-events: none;
  background: #1e293b;
  color: #f1f5f9;
  padding: 1rem 1.5rem;
  border-radius: 0.85rem;
  box-shadow: 0 8px 32px rgba(15,23,42,0.3);
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: 480px;
  width: calc(100% - 2rem);
  z-index: 99999;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
  border-left: 4px solid #f59e0b;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}

.toast-body {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  color: #f8fafc;
}

.toast-msg {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
}

.toast-close {
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}

.toast-close:hover { color: #f1f5f9; }

/* ── Error page ───────────────────────────────────────────────────────────── */
.error-card {
  background: white;
  border-radius: 1.5rem;
  padding: 3rem 2.5rem;
  max-width: 560px;
  width: 100%;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.1);
  text-align: center;
}

.error-illustration {
  margin: 0 auto 1.5rem;
  width: 160px;
}

.error-illustration svg {
  width: 100%;
  height: auto;
}

.error-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f59e0b;
  margin: 0 0 0.5rem;
}

.error-title {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1rem;
}

.error-body {
  color: #475569;
  line-height: 1.7;
  margin: 0 0 1.5rem;
}

.error-detail {
  display: inline-block;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 0.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
  font-family: monospace;
  text-align: left;
}

.error-tips {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1.1rem 1.25rem;
  text-align: left;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
  color: #475569;
}

.error-tips p {
  margin: 0 0 0.5rem;
  color: #1e293b;
}

.error-tips ul {
  margin: 0;
  padding-left: 1.25rem;
}

.error-tips li {
  margin-bottom: 0.35rem;
  line-height: 1.5;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.error-footer {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0;
}

/* ── Loading overlay ──────────────────────────────────────────────────────── */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(4px);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-title {
  color: #f1f5f9;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.loading-msg {
  color: #94a3b8;
  font-size: 0.92rem;
  text-align: center;
  max-width: 300px;
  line-height: 1.6;
  min-height: 2.5em;
}

.loading-dots span {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #38bdf8;
  border-radius: 50%;
  margin: 0 3px;
  animation: bounce 1.2s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Sponsored ad ──────────────────────────────────────────────────────────── */
.sponsored-section {
  padding-top: 0;
}

.sponsored-card {
  display: block;
  text-decoration: none;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 60%, #fff7ed 100%);
  border: 1.5px solid #fed7aa;
  border-radius: 1.25rem;
  padding: 1.75rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.sponsored-card::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, #f97316 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
}

.sponsored-card:hover {
  box-shadow: 0 12px 40px rgba(249, 115, 22, 0.15);
  transform: translateY(-2px);
}

.sponsored-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a3412;
  margin-bottom: 1rem;
  opacity: 0.7;
}

.sponsored-inner {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

.sponsored-img {
  border-radius: 0.75rem;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.sponsored-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sponsored-tag {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #f97316;
  margin: 0 0 0.3rem;
}

.sponsored-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.4rem;
}

.sponsored-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.sponsored-cta {
  display: inline-block;
  background: #f97316;
  color: white;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
}

.sponsored-badges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.s-badge {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .sponsored-inner {
    grid-template-columns: 1fr;
  }
  .sponsored-img {
    aspect-ratio: 16/7;
  }
  .sponsored-badges {
    display: none;
  }
}
