@import url('https://fonts.googleapis.com/css2?family=Jacques+Francois&family=Poppins:wght@400;500&display=swap');

:root {
  --bg: #ffffff;
  --card: #fdfbf7;
  --border: #e3ddd3;
  --ink: #363636;
  --ink-strong: #000000;
  --accent: #ab4d36;
  --muted: #696969;
  --muted-2: #999999;
  --btn: #343b1f;
  --btn-hover: #2a3018;
  --header: #000000;
  --radius-card: 20px;
  --radius-input: 10px;
  --max: 1144px;
  --page-pad: 70px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

/* Hide internal scrollbar when embedded so parent JS controls height */
html.embed-no-scroll,
html.embed-no-scroll body {
  overflow: hidden;
  height: auto;
}

body.embed-mode .standalone-only {
  display: none !important;
}

.page {
  max-width: 96% !important;
  margin: 0 auto;
  padding: 60px 0 !important;
}

.intro h1 {
  margin: 0 0 24px;
  color: var(--ink);
  font-family: 'Jacques Francois', Georgia, serif;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 400;
  line-height: 1.1;
}

.intro p {
  margin: 0 0 18px;
  max-width: var(--max);
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.2;
  color: var(--ink);
}

.intro .expect {
  margin-top: 8px;
  margin-bottom: 28px;
  color: var(--ink);
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 40px;
}

.section-num {
  color: var(--accent);
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 20px;
}

.field-label {
  display: block;
  margin: 0 0 16px;
  color: var(--ink-strong);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
}

.field-label .req {
  color: var(--accent);
}

.field-label .opt {
  color: var(--muted-2);
  font-size: 0.8em;
}

.field-group {
  margin-bottom: 24px;
}

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

.hint {
  margin: 0 0 20px;
  font-size: clamp(16px, 1.6vw, 24px);
  line-height: 1.25;
  color: var(--ink);
}

.row {
  display: grid;
  gap: 30px;
}

.row-2 {
  grid-template-columns: 1fr 1fr;
}

.row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
select,
textarea {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 22px 26px;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink-strong);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

input::placeholder,
textarea::placeholder {
  color: #000;
  opacity: 0.55;
}

/* Hide native select — custom dropdown UI replaces it */
.select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  clip: rect(0, 0, 0, 0) !important;
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 22px 26px;
  padding-right: 28px;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.2;
  color: var(--ink-strong);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select-trigger:hover {
  border-color: #c4b8a8;
}

.custom-select.is-open .custom-select-trigger,
.custom-select-trigger:focus {
  outline: none;
  border-color: #c4b8a8;
  box-shadow: 0 0 0 3px rgba(171, 77, 54, 0.12);
}

.custom-select.is-invalid .custom-select-trigger,
.custom-select-trigger.is-invalid {
  border: 2px solid #ff0000 !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
}

.custom-select-label {
  flex: 1;
  min-width: 0;
}

.custom-select-label.is-placeholder {
  color: #000;
  opacity: 0.55;
}

.custom-select-caret {
  flex-shrink: 0;
  width: 14px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select-caret {
  transform: rotate(180deg);
}

.custom-select-menu {
  display: none;
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  box-shadow: 0 10px 28px rgba(54, 54, 54, 0.1);
  scrollbar-width: thin;
}

.custom-select.is-open .custom-select-menu {
  display: block;
}

.custom-select-option {
  padding: 14px 26px;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink-strong);
  cursor: pointer;
}

.custom-select-option:hover,
.custom-select-option.is-active {
  background: #f7f3ec;
}

.custom-select-option.is-selected {
  color: var(--accent);
}

.custom-select-option[aria-disabled='true'] {
  display: none;
}

input:focus,
textarea:focus {
  border-color: #c4b8a8;
  box-shadow: 0 0 0 3px rgba(171, 77, 54, 0.12);
}

input.is-invalid,
textarea.is-invalid {
  border: 2px solid #ff0000 !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-input);
  padding: 18px 40px;
  background: var(--btn);
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

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

.btn:active {
  transform: translateY(1px);
}

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

.btn-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.form-footer {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-top: 24px;
  width: 100%;
}

.form-footer-btn {
  flex: 0 0 20%;
  max-width: 20%;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.form-footer-btn .btn {
  width: 100%;
  white-space: normal;
  line-height: 1.25;
  padding-left: 16px;
  padding-right: 16px;
}

.form-footer-copy {
  flex: 1 1 80%;
  max-width: 80%;
}

.form-footer-copy p {
  margin: 0 0 14px;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.35;
  color: var(--ink);
}

.form-footer-copy p:last-child {
  margin-bottom: 0;
}

.upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  padding: 28px;
  background: #fff;
  border: 1px dashed #c9c2b6;
  border-radius: var(--radius-input);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-zone:hover,
.upload-zone.is-dragover {
  border-color: var(--accent);
  background: #fffaf5;
}

.upload-zone.is-invalid {
  border: 2px dashed #ff0000 !important;
  background: #fff8f5;
}

.upload-zone input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-icon {
  width: 44px;
  height: 44px;
  color: #2b2b2b;
}

.upload-zone .primary {
  color: #000;
  font-size: 20px;
}

.upload-zone .secondary {
  color: var(--muted);
}

.upload-zone .meta {
  color: #6d6d6d;
  font-size: 18px;
}

.file-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  color: var(--ink);
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.file-list button {
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 15px;
  cursor: pointer;
}

.conditional {
  display: none;
  margin-top: 20px;
  padding-top: 4px;
}

.conditional.is-open {
  display: block;
}

.gate-message {
  display: none;
  margin-top: 20px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.35;
  color: var(--ink);
}

.gate-message.is-visible {
  display: block;
}

.gate-message.is-error {
  border-color: #d7c4b8;
  background: #fff8f5;
}

#post-gate {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.closing {
  max-width: var(--max);
  margin-top: 48px;
}

.closing p {
  margin: 0 0 16px;
  font-size: clamp(18px, 1.8vw, 24px);
  line-height: 1.25;
}

.status-banner {
  display: none;
  margin: 24px 0;
  padding: 18px 22px;
  border-radius: var(--radius-input);
  font-size: 18px;
}

.status-banner.is-visible {
  display: block;
}

.status-banner.success {
  background: #eef2e4;
  border: 1px solid #c9d2b0;
  color: #2f3618;
}

.status-banner.error {
  background: #fff8f5;
  border: 1px solid #e0c8be;
  color: #7a3a2a;
}

.success-panel {
  margin-top: 36px;
  background: #eef2e4;
  border-color: #c9d2b0;
}

.success-panel .section-num {
  color: #343b1f;
}

.success-panel .field-label {
  font-size: clamp(18px, 1.8vw, 24px);
  color: #2f3618;
}

.field-error {
  display: none;
  margin-top: 8px;
  color: var(--accent);
  font-size: 15px;
}

.field-error.is-visible {
  display: block;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px var(--page-pad, 40px);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-brand {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--ink-strong);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav a {
  font-family: Georgia, serif;
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav a:hover,
.nav a.active {
  color: var(--accent);
}

.hint {
  margin: 24px 0 32px 0;
  line-height: 1.5;
  color: var(--ink-soft);
  font-size: 16px;
}

@media (max-width: 900px) {
  :root {
    --page-pad: 24px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px var(--page-pad);
    gap: 16px;
  }

  .nav {
    gap: 20px;
    flex-wrap: wrap;
  }

  .nav a {
    font-size: 16px;
  }

  .card {
    padding: 28px 22px;
  }

  .row-2,
  .row-3 {
    grid-template-columns: 1fr;
  }

  .btn-wrap {
    justify-content: stretch;
  }

  .btn {
    width: 100%;
  }

  .form-footer {
    flex-direction: column;
    gap: 20px;
  }

  .form-footer-btn,
  .form-footer-copy {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
