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

:root {
  --bg:            #F5F0EA;
  --card:          #FFFFFF;
  --border:        #D6C9B6;
  --accent:        #B8976A;
  --accent-hover:  #A07D50;
  --text:          #2C2C2C;
  --muted:         #7A6E63;
  --pressing-bg:   #FAF6F0;
  --success:       #6B8F71;
  --error:         #C0392B;
  --error-bg:      #FDF0EE;
  --shadow:        0 2px 24px rgba(0,0,0,0.07);
  --radius:        12px;
  --radius-sm:     6px;
}

html { font-size: 16px; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
  line-height: 1.5;
}

/* ── Card ── */
.page { width: 100%; max-width: 520px; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px;
}

/* ── Header ── */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.brand {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 6px;
}

/* ── Layout ── */
.row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.row-three {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* ── Fields ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
}

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

label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.required {
  color: var(--accent);
  font-size: 1rem;
  line-height: 0;
  vertical-align: middle;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237A6E63' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

input::placeholder { color: #B5ADA5; }

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,151,106,0.15);
}

input.is-error,
select.is-error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

.field-error {
  font-size: 0.78rem;
  color: var(--error);
  min-height: 1em;
  display: block;
}

/* ── Upload zone ── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  overflow: hidden;
  position: relative;
}

.upload-zone:hover,
.upload-zone:focus {
  border-color: var(--accent);
  background: #FBF8F4;
  outline: none;
}

.upload-zone.drag-over {
  border-color: var(--accent);
  background: #FBF8F4;
  box-shadow: 0 0 0 3px rgba(184,151,106,0.15);
}

.upload-zone.is-error { border-color: var(--error); }

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  gap: 8px;
  text-align: center;
}

.camera-icon {
  width: 36px;
  height: 36px;
  color: var(--border);
  flex-shrink: 0;
}

.upload-text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.upload-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.upload-hint {
  font-size: 0.75rem;
  color: #B5ADA5;
}

.upload-preview {
  position: relative;
}

.upload-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: var(--bg);
}

.remove-photo {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(44,44,44,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.remove-photo:hover { background: rgba(44,44,44,0.85); }

.remove-photo svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

/* ── Pressing section ── */
.pressing-section {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}

.pressing-section.visible {
  max-height: 260px;
  opacity: 1;
}

.pressing-inner {
  border-left: 3px solid var(--accent);
  background: var(--pressing-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 16px 20px;
  margin-bottom: 16px;
}

.pressing-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 14px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Submit button ── */
.btn-submit {
  width: 100%;
  height: 52px;
  background: var(--accent);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 24px;
  letter-spacing: 0.02em;
}

.btn-submit:hover { background: var(--accent-hover); }
.btn-submit:active { transform: scale(0.98); }
.btn-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form-level error ── */
.form-error {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--error-bg);
  border: 1px solid rgba(192,57,43,0.25);
  border-radius: var(--radius-sm);
  color: var(--error);
  font-size: 0.88rem;
  line-height: 1.4;
}

/* ── Success screen ── */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 8px 8px;
  gap: 12px;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.success-icon svg {
  width: 30px;
  height: 30px;
  stroke: #fff;
}

.success-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--text);
}

.success-msg {
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 280px;
}

.btn-reset {
  margin-top: 8px;
  padding: 0 28px;
  height: 46px;
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-reset:hover {
  background: var(--accent);
  color: #fff;
}

/* ── Utilities ── */
.hidden { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── Mobile overrides ── */
@media (max-width: 480px) {
  body { padding: 12px 12px 32px; }
  .card { padding: 20px 16px 24px; }
  .card-header { margin-bottom: 20px; }

  /* Row-two: stack fields, tighter gap within group, consistent gap between groups */
  .row-two {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 16px;
  }
  .row-two .field { margin-bottom: 8px; }
  .row-two .field:last-child { margin-bottom: 0; }

  .row-three { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

  .brand { font-size: 1.35rem; }
  .upload-placeholder { padding: 20px 12px; }
  .btn-submit { margin-top: 16px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
