:root {
  --pine: #16382e;
  --forest: #20483b;
  --sage: #61796f;
  --clay: #aa6a45;
  --sand: #e6d7c2;
  --paper: #fbf7ef;
  --mist: #edf4ef;
  --ink: #20312a;
  --white: #ffffff;
  --shadow: 0 28px 70px rgba(26, 43, 35, 0.12);
  --radius-lg: 30px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Sarabun", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(230, 215, 194, 0.7), transparent 30%),
    radial-gradient(circle at top right, rgba(97, 121, 111, 0.22), transparent 26%),
    linear-gradient(165deg, #f4efe4 0%, #eef4ee 54%, #f8f2e9 100%);
}

img {
  max-width: 100%;
  display: block;
}

.page-shell {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.page-shell::before,
.page-shell::after {
  content: "";
  position: fixed;
  inset: auto;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.page-shell::before {
  width: 22rem;
  height: 22rem;
  top: -7rem;
  right: -5rem;
  background: radial-gradient(circle, rgba(170, 106, 69, 0.18) 0%, rgba(170, 106, 69, 0) 72%);
}

.page-shell::after {
  width: 28rem;
  height: 28rem;
  bottom: -12rem;
  left: -8rem;
  background: radial-gradient(circle, rgba(22, 56, 46, 0.12) 0%, rgba(22, 56, 46, 0) 70%);
}

.site {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
  position: relative;
  z-index: 1;
}

.hero,
.application-panel,
.form-section {
  animation: rise 0.7s ease both;
}

.hero {
  margin-bottom: 2rem;
}

.hero-copy,
.application-panel,
.form-section {
  backdrop-filter: blur(12px);
}

.hero-copy {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 252, 247, 0.88), rgba(255, 255, 255, 0.58));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

.hero-copy-main {
  min-width: 0;
}

.eyebrow,
.section-heading span {
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  color: var(--clay);
  font-weight: 700;
}

h1,
h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-weight: 600;
  line-height: 1;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  margin-bottom: 0.5rem;
}

h3 {
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  margin-bottom: 0.3rem;
}

.panel-copy,
.section-heading p,
.signature-head p {
  line-height: 1.6;
}

.hero-subtitle {
  margin: 0;
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  color: rgba(32, 49, 42, 0.76);
  font-weight: 600;
}

.download-panel {
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, rgba(22, 56, 46, 0.94), rgba(32, 72, 59, 0.9));
  border: 1px solid rgba(22, 56, 46, 0.18);
  box-shadow: 0 18px 36px rgba(22, 56, 46, 0.18);
  color: var(--paper);
}

.download-panel p {
  margin: 0.8rem 0 0;
  color: rgba(251, 247, 239, 0.82);
}

.application-panel {
  padding: 1.2rem;
  border-radius: calc(var(--radius-lg) + 4px);
  background: rgba(251, 247, 239, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
}

.panel-header {
  display: grid;
  gap: 1rem;
  padding: 1rem 1rem 1.4rem;
}

.panel-copy {
  max-width: 36rem;
  margin: 0;
  color: rgba(32, 49, 42, 0.8);
}

form {
  display: grid;
  gap: 1rem;
}

.form-section {
  padding: 1.25rem;
  border-radius: calc(var(--radius-md) + 4px);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(230, 215, 194, 0.9);
  box-shadow: 0 12px 30px rgba(26, 43, 35, 0.06);
}

.form-section:nth-of-type(2) {
  animation-delay: 0.08s;
}

.form-section:nth-of-type(3) {
  animation-delay: 0.14s;
}

.form-section:nth-of-type(4) {
  animation-delay: 0.2s;
}

.form-section:nth-of-type(5) {
  animation-delay: 0.26s;
}

.form-section:nth-of-type(6) {
  animation-delay: 0.32s;
}

.form-section:nth-of-type(7) {
  animation-delay: 0.38s;
}

.section-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.section-heading span {
  width: 2.6rem;
  height: 2.6rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 700;
}

.section-heading p {
  margin: 0;
  color: rgba(32, 49, 42, 0.72);
}

.field-grid {
  display: grid;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.rent-grid {
  grid-template-columns: minmax(0, 1fr);
}

.field-grid:last-child {
  margin-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.field[hidden] {
  display: none !important;
}

.field:last-child {
  margin-bottom: 0;
}

.field-grid > .field {
  margin-bottom: 0;
  align-self: start;
}

.field span,
.choice-group legend {
  font-size: 0.93rem;
  font-weight: 700;
}

.field span {
  display: block;
  line-height: 1.25;
}

.field-grid .field span {
  display: flex;
  align-items: flex-end;
  height: 3rem;
}

.field-note {
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(32, 49, 42, 0.72);
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid rgba(97, 121, 111, 0.28);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1rem;
  font: inherit;
  color: var(--ink);
  background: rgba(251, 247, 239, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input {
  min-height: 3.35rem;
}

.field textarea {
  resize: vertical;
  min-height: 6.5rem;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--clay);
  box-shadow: 0 0 0 4px rgba(170, 106, 69, 0.16);
  transform: translateY(-1px);
}

.upload-field input[type="file"] {
  padding: 0.7rem 0.8rem;
  min-height: 3.35rem;
  background: rgba(255, 255, 255, 0.88);
}

.upload-field input[type="file"]::file-selector-button {
  margin-right: 0.8rem;
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1rem;
  font: inherit;
  font-weight: 700;
  background: linear-gradient(135deg, var(--forest), var(--pine));
  color: var(--paper);
  cursor: pointer;
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}

.choice-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.choice-pill {
  position: relative;
  display: flex;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  width: 100%;
  border-radius: 999px;
  padding: 0.82rem 0.85rem;
  text-align: center;
  font-weight: 700;
  border: 1px solid rgba(97, 121, 111, 0.26);
  background: rgba(251, 247, 239, 0.75);
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.choice-pill input:checked + span {
  background: linear-gradient(135deg, var(--forest), var(--pine));
  border-color: transparent;
  color: var(--paper);
  transform: translateY(-1px);
}

.info-card {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(180deg, rgba(237, 244, 239, 0.68), rgba(251, 247, 239, 0.84));
  border: 1px solid rgba(97, 121, 111, 0.22);
}

.info-card:last-child {
  margin-bottom: 0;
}

.info-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.info-card-header strong,
.info-card-header span {
  display: inline-block;
}

.info-card-header span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(32, 72, 59, 0.1);
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-card p {
  margin: 0 0 0.75rem;
  color: rgba(32, 49, 42, 0.8);
}

.info-list {
  margin: 0;
  padding-left: 1.2rem;
  color: rgba(32, 49, 42, 0.9);
}

.info-list li + li {
  margin-top: 0.45rem;
}

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(32, 72, 59, 0.1);
  color: var(--forest);
  font-size: 0.86rem;
  font-weight: 700;
}

.signature-card {
  border-radius: calc(var(--radius-md) + 2px);
  padding: 1rem;
  background: linear-gradient(180deg, rgba(237, 244, 239, 0.72), rgba(251, 247, 239, 0.76));
  border: 1px solid rgba(97, 121, 111, 0.2);
}

.signature-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}

.signature-head strong {
  display: block;
  margin-bottom: 0.3rem;
}

.signature-head p {
  margin: 0;
  color: rgba(32, 49, 42, 0.72);
}

#signature-pad {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(251, 247, 239, 0.96), rgba(255, 255, 255, 0.92)),
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent 38px,
      rgba(170, 106, 69, 0.14) 39px,
      transparent 40px
    );
  border: 1px dashed rgba(170, 106, 69, 0.48);
}

.submit-row {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 0.5rem 0.25rem 0.25rem;
}

.form-response {
  min-height: 1.5rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: none;
}

.form-response[data-state="success"] {
  display: block;
  background: rgba(32, 72, 59, 0.1);
  color: var(--forest);
  border: 1px solid rgba(32, 72, 59, 0.18);
}

.form-response[data-state="error"] {
  display: block;
  background: rgba(170, 106, 69, 0.12);
  color: #7e3f1c;
  border: 1px solid rgba(170, 106, 69, 0.22);
}

.primary-button,
.secondary-button {
  appearance: none;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border-radius: 999px;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--clay), #c4804f);
  color: var(--paper);
  box-shadow: 0 16px 26px rgba(170, 106, 69, 0.22);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.primary-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(170, 106, 69, 0.28);
}

.primary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.secondary-button {
  border-radius: 999px;
  padding: 0.7rem 0.95rem;
  background: rgba(255, 255, 255, 0.76);
  color: var(--forest);
  border: 1px solid rgba(97, 121, 111, 0.24);
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sand), #f2e8d7);
  color: var(--pine);
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
  box-shadow: 0 12px 24px rgba(18, 39, 31, 0.18);
}

.download-link:hover,
.download-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(18, 39, 31, 0.24);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 700px) {
  .site {
    width: min(1180px, calc(100% - 3rem));
    padding-top: 2.5rem;
  }

  .hero-copy {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 1.5rem;
  }

  .panel-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .two-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .three-up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .applicant-primary-grid {
    grid-template-columns: minmax(0, 1.8fr) minmax(120px, 0.6fr) minmax(180px, 0.9fr);
  }

  .rent-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .rental-choice-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .choice-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .submit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 980px) {
  .application-panel {
    padding: 1.4rem;
  }

  form {
    gap: 1.15rem;
  }
}

@media (max-width: 699px) {
  .site {
    width: min(100% - 1rem, 1120px);
    padding-top: 1rem;
  }

  .hero-copy,
  .application-panel,
  .form-section {
    padding: 1.1rem;
  }

  .signature-head {
    flex-direction: column;
    align-items: stretch;
  }

  .download-panel {
    width: 100%;
  }
}
