:root {
  --green-deep: #10251c;
  --green: #1b3d2f;
  --green-soft: #254a3b;
  --gold: #c9a36a;
  --gold-light: #e8d5ad;
  --cream: #f7f1e6;
  --white: #fffcf7;
  --text: #1a2a22;
  --muted: #5c6b63;
  --error: #9b2c2c;
  --shadow: 0 18px 50px rgba(8, 22, 16, 0.28);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: Manrope, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, #2d5a45 0%, var(--green-deep) 48%, #0b1812 100%);
  min-height: 100vh;
}

.page {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.hero {
  text-align: center;
  color: var(--cream);
  margin-bottom: 28px;
}

.lang-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.lang-btn {
  border: 1px solid rgba(201, 163, 106, 0.5);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold-light);
  background: transparent;
  cursor: pointer;
}

.lang-btn[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--green-deep);
  background: var(--gold);
}

.lang-btn:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

.brand-mark {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--gold-light);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--white);
}

.subtitle {
  margin-top: 8px;
  font-size: 1.05rem;
  color: #dce8e1;
}

.table-badge {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  font-weight: 600;
  background: rgba(201, 163, 106, 0.08);
}

.layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--white);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.7rem, 5vw, 2rem);
  color: var(--green);
}

.card-lead {
  margin: 8px 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.required {
  color: var(--gold);
}

select,
textarea {
  width: 100%;
  border: 1px solid #d8cbb6;
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--cream);
}

select:focus,
textarea:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.field-error {
  margin-top: 6px;
  color: var(--error);
  font-size: 0.9rem;
}

.table-warning,
.form-error {
  margin-bottom: 18px;
  color: var(--error);
  font-size: 0.9rem;
  line-height: 1.45;
}

.demo-banner {
  margin-bottom: 18px;
  padding: 8px 14px;
  border: 2px dashed var(--gold);
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--green-deep);
  background: var(--gold-light);
}

.place-alert {
  margin-bottom: 18px;
}

.place-alert .table-warning {
  margin-bottom: 10px;
}

/* Поле-ловушка: убрано с экрана, но остаётся в форме. */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.photo-title {
  margin-bottom: 8px;
  font-weight: 600;
}

.photo-optional {
  font-weight: 400;
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.photo-btn {
  display: inline-block;
  margin-bottom: 0;
}

.visually-hidden:focus-visible + .photo-btn {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden:disabled + .photo-btn {
  opacity: 0.5;
  cursor: not-allowed;
}

.photo-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.photo-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.photo-list:empty {
  display: none;
}

.photo-item img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #eadfcb;
  border-radius: 10px;
}

.photo-remove {
  width: 100%;
  margin-top: 6px;
  padding: 6px 8px;
  font-size: 0.85rem;
}

.field.invalid select,
.field.invalid textarea {
  border-color: var(--error);
}

.submit-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: var(--green-deep);
  background: linear-gradient(180deg, #e8d5ad, var(--gold));
  cursor: pointer;
}

.submit-btn:hover {
  filter: brightness(1.05);
}

.submit-btn:active {
  transform: translateY(1px);
}

.steps {
  list-style: none;
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--gold-light);
  font-weight: 700;
}

.steps h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.steps p {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.95rem;
}

.history-card {
  margin-top: 20px;
}

.history-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.history-lead {
  margin-bottom: 0;
}

.clear-btn,
.ghost-btn {
  flex-shrink: 0;
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  color: var(--green);
  background: transparent;
  cursor: pointer;
}

.clear-btn:hover,
.ghost-btn:hover {
  background: var(--cream);
}

.storage-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-item .ghost-btn {
  margin-top: 10px;
}

.history-empty {
  margin-top: 18px;
  color: var(--muted);
}

.history-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.history-item {
  border: 1px solid #eadfcb;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--cream);
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}

.status-badge {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 0.8rem;
}

.history-item h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.history-item p {
  color: var(--text);
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

footer {
  text-align: center;
  color: #c5d4cc;
  margin-top: 24px;
  font-size: 0.92rem;
}

.toast {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.55);
  display: grid;
  place-items: center;
  padding: 20px;
}

.toast[hidden] {
  display: none;
}

.toast-inner {
  width: min(420px, 100%);
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  border-top: 4px solid var(--gold);
  box-shadow: var(--shadow);
}

.toast-inner strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.8rem;
  color: var(--green);
  margin-bottom: 8px;
}

.toast-inner p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 18px;
}

.toast-inner .form-error {
  color: var(--error);
}

.toast-close {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 700;
  background: var(--green);
  color: var(--cream);
  cursor: pointer;
}

@media (max-width: 800px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .card {
    padding: 22px 16px;
    min-width: 0;
  }

  .history-head {
    flex-direction: column;
  }

  .status-badge {
    margin-left: 0;
  }
}
