:root {
  --bg: #f4f2ea;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #1f2733;
  --muted: #5f6a78;
  --line: #d7d1c2;
  --accent: #0d4f6d;
  --accent-strong: #083c54;
  --danger: #ad2e24;
  --shadow: 0 20px 50px rgba(16, 37, 56, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Sora", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 214, 154, 0.28), transparent 35%),
    radial-gradient(circle at 85% 10%, rgba(111, 197, 210, 0.24), transparent 30%),
    linear-gradient(180deg, #f7f5ef 0%, #f1ece1 100%);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(45px);
  pointer-events: none;
  z-index: -1;
}

.orb-a {
  width: 260px;
  height: 260px;
  background: rgba(246, 181, 85, 0.35);
  top: -70px;
  right: 8%;
}

.orb-b {
  width: 300px;
  height: 300px;
  background: rgba(32, 125, 154, 0.25);
  left: -60px;
  bottom: 10%;
}

.layout {
  width: min(1180px, calc(100vw - 2rem));
  margin: 2rem auto 3rem;
}

.hero {
  margin-bottom: 1.4rem;
  padding: 1.25rem 1.5rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

h1 {
  margin: 0.25rem 0 0.4rem;
  font-family: "Merriweather", serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 820px;
}

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

.card,
.preview-shell {
  background: color-mix(in srgb, var(--surface) 90%, #ffffff 10%);
  border: 1px solid color-mix(in srgb, var(--line) 88%, white 12%);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.card {
  padding: 1.1rem;
}

.card h2,
.preview-shell h2 {
  margin: 0 0 0.9rem;
  font-family: "Merriweather", serif;
  font-size: 1.25rem;
}

.field {
  display: grid;
  gap: 0.38rem;
  position: relative;
}

.field label {
  font-size: 0.86rem;
  color: #425266;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c6ced6;
  border-radius: 11px;
  background: #fff;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: var(--ink);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

textarea {
  resize: vertical;
  min-height: 72px;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(13, 79, 109, 0.14);
  outline: none;
}

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

.span-2 {
  grid-column: 1;
}

.suggestions {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  background: var(--surface-strong);
  border: 1px solid #d3d9e0;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(22, 41, 57, 0.18);
  overflow: hidden;
  display: none;
  z-index: 10;
}

.suggestions.visible {
  display: block;
}

.suggestion-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e5e9ee;
  padding: 0.65rem 0.75rem;
  text-align: left;
  background: white;
  cursor: pointer;
  display: grid;
  gap: 0.22rem;
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: #f2f7fb;
  outline: none;
}

.suggestion-title {
  font-weight: 600;
}

.suggestion-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.hint {
  margin: -0.3rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.checklist {
  display: grid;
  gap: 0.58rem;
}

.checklist label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: #2c3948;
  font-size: 0.93rem;
}

.checklist input[type="checkbox"] {
  margin-top: 0.14rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.1rem;
  margin: 0.55rem 0 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 140ms ease;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 12px 20px rgba(8, 60, 84, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: #edf2f6;
  color: #34495f;
}

.btn-ghost:hover {
  background: #e5edf4;
}

.info {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-shell {
  margin-top: 0.2rem;
  padding: 1.1rem;
}

.document {
  width: min(100%, 794px);
  margin: 0 auto;
  background: white;
  border: 1px solid #d4d4d4;
  padding: 34px 34px 38px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.26;
  color: #111;
}

.document h3 {
  margin: 0 0 28px;
  text-align: center;
  font-size: 2.95rem;
  text-transform: none;
}

.pm-row {
  display: grid;
  grid-template-columns: 185px 1fr;
  column-gap: 18px;
  align-items: end;
  margin: 0 0 8px;
}

.pm-label {
  font-size: 1.03rem;
  color: #232323;
}

.pm-value {
  border-bottom: 1px dotted #6f6f6f;
  min-height: 1.35rem;
  padding: 0 0 3px;
  word-break: break-word;
  font-size: 1.03rem;
}

.pm-note {
  margin: 4px 0 20px;
  font-size: 1.03rem;
}

.pm-verb {
  margin: 2px 0 18px;
  font-size: 1.08rem;
}

.pm-text {
  margin: 0 0 6px;
  font-size: 1.04rem;
}

.pm-actions {
  margin: 0 0 18px 18px;
  padding: 0;
  list-style: none;
}

.pm-actions li {
  margin: 2px 0;
  position: relative;
  padding-left: 16px;
  font-size: 1.03rem;
}

.pm-actions li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
}

.pm-vehicle {
  margin-bottom: 8px;
}

.pm-vehicle-first {
  margin-top: 14px;
}

.pm-vehicle-last {
  margin-bottom: 14px;
}

.pm-bottom {
  margin-top: 14px;
  margin-bottom: 54px;
}

.pm-signature {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
  font-size: 1.03rem;
}

.pm-sign-right {
  display: grid;
  justify-items: center;
  min-width: 220px;
}

.pm-sign-line {
  width: 100%;
  border-bottom: 1px dotted #6f6f6f;
  height: 0.95rem;
}

.pm-sign-role {
  margin-top: 3px;
  font-size: 0.94rem;
  font-style: italic;
}

@media (min-width: 840px) {
  .grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }
}

@media (max-width: 780px) {
  .layout {
    width: min(100vw - 1.1rem, 1180px);
    margin-top: 1.2rem;
  }

  .hero {
    padding: 0.8rem 0.25rem;
  }

  .document {
    padding: 20px 16px 24px;
  }

  .document h3 {
    margin-bottom: 18px;
    font-size: 2.15rem;
  }

  .pm-row {
    grid-template-columns: 146px 1fr;
    column-gap: 10px;
  }

  .pm-label,
  .pm-value,
  .pm-note,
  .pm-verb,
  .pm-text,
  .pm-actions li,
  .pm-signature {
    font-size: 0.92rem;
  }
}
