/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:   #1a1a2e;
  --red:    #e63946;
  --light:  #f5f5f5;
  --white:  #ffffff;
  --text:   #2d2d2d;
  --muted:  #666;
  --border: #dde1e7;
  --radius: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,.08);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Site header ── */
.site-header {
  background: var(--navy);
  color: white;
  padding: 18px 24px;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.logo { font-size: 1.3rem; font-weight: 700; letter-spacing: -.5px; }
.tagline { font-size: .9rem; opacity: .65; }

/* ── Form page ── */
.form-container {
  max-width: 780px;
  margin: 40px auto;
  padding: 0 16px;
  flex: 1;
}
.form-title { font-size: 1.8rem; color: var(--navy); margin-bottom: 6px; }
.form-subtitle { color: var(--muted); margin-bottom: 32px; }

fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  background: var(--white);
  box-shadow: var(--shadow);
}
legend {
  font-weight: 600;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--red);
  padding: 0 8px;
}

.field { display: flex; flex-direction: column; gap: 5px; margin-top: 16px; }
.field:first-child { margin-top: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

label { font-size: .9rem; font-weight: 600; color: var(--navy); }
.required { color: var(--red); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }

input, select, textarea {
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--text);
  background: white;
  transition: border-color .15s;
  width: 100%;
  min-width: 0;
  height: 44px;
  box-sizing: border-box;
}
textarea { height: auto; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
}
textarea { resize: vertical; }

/* ── Language toggle ── */
.lang-toggle {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.lang-option input[type="radio"] { display: none; }
.lang-option:has(input:checked) {
  border-color: var(--navy);
  background: #eef0f5;
}
.lang-option:hover { border-color: var(--navy); }
.lang-option b {
  background: var(--navy);
  color: white;
  font-size: .75rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: .04em;
}
.lang-option:has(input:checked) b { background: var(--red); }

.submit-btn {
  width: 100%;
  padding: 15px;
  background: var(--red);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s, opacity .2s;
}
.submit-btn:hover { background: #c1121f; }
.submit-btn:disabled { opacity: .65; cursor: not-allowed; }

/* ── Site footer ── */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Action bar (proposal page) ── */
.action-bar {
  background: var(--navy);
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.action-bar-bottom { position: static; margin-top: 0; }
.action-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.back-link { color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; }
.back-link:hover { color: white; }
.action-buttons { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.email-notice { color: rgba(255,255,255,.8); font-size: .85rem; }
.print-btn {
  background: var(--red);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.print-btn:hover { background: #c1121f; }

/* ── Proposal content ── */
.proposal-wrapper {
  max-width: 860px;
  margin: 36px auto;
  padding: 0 16px 48px;
}

/* Styles that apply to the AI-generated .proposal div */
.proposal {
  background: white;
  padding: 56px 64px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  line-height: 1.7;
}
@media (max-width: 600px) { .proposal { padding: 28px 20px; } }

.proposal h1 {
  font-size: 1.9rem;
  color: var(--navy);
  border-bottom: 3px solid var(--red);
  padding-bottom: 14px;
  margin-bottom: 8px;
  line-height: 1.3;
}
.proposal .meta {
  color: var(--muted);
  font-style: italic;
  margin-bottom: 36px;
  font-size: .9rem;
}
.proposal h2 {
  font-size: 1.2rem;
  color: var(--navy);
  margin-top: 40px;
  margin-bottom: 14px;
  border-left: 4px solid var(--red);
  padding-left: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.proposal p { margin-bottom: 14px; }
.proposal ul, .proposal ol { padding-left: 22px; margin-bottom: 14px; }
.proposal li { margin-bottom: 6px; }

/* Tables */
.proposal table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 28px;
  font-size: .93rem;
}
.proposal th {
  background: var(--navy);
  color: white;
  padding: 11px 14px;
  text-align: left;
  font-weight: 600;
}
.proposal td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.proposal tr:nth-child(even) td { background: #f9f9f9; }
.proposal tr:last-child td { font-weight: 700; background: #f0f0f0; }

.proposal .footer-note {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--muted);
}

/* ── Proposal page body ── */
body.proposal-page { background: var(--light); }

/* ── Auth pages ── */
.auth-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px;
  flex: 1;
}
.auth-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
  width: 100%;
  max-width: 420px;
}
.pricing-card { max-width: 480px; }
.auth-title { font-size: 1.6rem; color: var(--navy); margin-bottom: 6px; }
.auth-sub { color: var(--muted); margin-bottom: 28px; font-size: .95rem; }
.auth-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: .9rem;
}
.auth-switch { text-align: center; margin-top: 24px; font-size: .9rem; color: var(--muted); }
.auth-switch a { color: var(--navy); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { color: var(--red); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-email { font-size: .85rem; opacity: .7; }
.logout-link { font-size: .85rem; color: rgba(255,255,255,.75); text-decoration: none; }
.logout-link:hover { color: white; }

/* Pricing features */
.pricing-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.pricing-features li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: .95rem;
  color: var(--text);
}
.pricing-features li:last-child { border-bottom: none; }
