@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

/* ══════════════════════════════════════
   VARIABLES
══════════════════════════════════════ */
:root {
  --gold:        #C9A84C;
  --gold-dark:   #8B6914;
  --gold-light:  #E8D5A3;
  --cream:       #FDF8F0;
  --dark:        #1A0F00;
  --card-bg:     rgba(253, 248, 240, 0.52);
  --card-border: rgba(201, 168, 76, 0.45);
  --text-dark:   #2C1A06;
  --shadow:      0 8px 32px rgba(0,0,0,0.35);
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { height: 100%; }

body {
  height: 100%;
  font-family: 'Lato', sans-serif;
  background: #0e0900;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ══════════════════════════════════════
   APP / SCREENS
══════════════════════════════════════ */
#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.screen.active {
  display: flex;
  animation: screenIn 0.55s var(--ease) forwards;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   BACKGROUND
══════════════════════════════════════ */
.screen-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
  z-index: 0;
}

/* ══════════════════════════════════════
   FRAME (moldura)
══════════════════════════════════════ */
.frame-wrap {
  position: relative;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding: 0 12px;
  z-index: 2;
}

.frame-backer, .frame-img, .frame-img-canvas { display: none; }


.frame-inner {
  position: relative;
  z-index: 10;
  padding: 44px 28px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background: rgba(253, 248, 240, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 16px;
  border: 1.5px solid rgba(201, 168, 76, 0.5);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.45),
    0 4px 20px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Form screen needs scroll */
.frame-inner.scrollable {
  overflow-y: auto;
  max-height: 92vh;
  padding: 56px 24px 60px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.frame-inner.scrollable::-webkit-scrollbar { width: 4px; }
.frame-inner.scrollable::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ══════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════ */
.title-main {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 6vw, 2.4rem);
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  line-height: 1.2;
  text-shadow: 1px 2px 10px rgba(255,255,255,0.6);
}

.title-italic {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 3.5vw, 1.15rem);
  font-style: italic;
  color: var(--gold-dark);
  text-align: center;
  margin-top: 6px;
}

.ornament {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 14px auto;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
  text-align: left;
}

/* ══════════════════════════════════════
   CARD
══════════════════════════════════════ */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
  width: 100%;
  margin-bottom: 14px;
}

.card p {
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--text-dark);
}

.card strong { color: var(--gold-dark); }

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 28px;
  border: none;
  border-radius: 50px;
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
  text-decoration: none;
  margin-top: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #D4A843 0%, #8B6914 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(201,168,76,0.55);
}
.btn-primary:hover  { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(201,168,76,0.65); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,0.3);
  border: 2px solid var(--gold);
  color: var(--gold-dark);
}
.btn-ghost:hover { background: rgba(201,168,76,0.12); }

.btn-danger {
  background: rgba(160,30,30,0.75);
  color: #fff;
}
.btn-danger:hover { background: rgba(160,30,30,0.9); }

.btn-sm {
  padding: 10px 20px;
  font-size: 0.88rem;
  margin-top: 6px;
}

/* ══════════════════════════════════════
   QUESTION CARDS
══════════════════════════════════════ */
.question-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.22);
}

.q-text {
  font-family: 'Playfair Display', serif;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 13px;
  line-height: 1.4;
}

.q-number {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: 0.7rem;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  border-radius: 50%;
  width: 20px; height: 20px;
  text-align: center;
  line-height: 20px;
  margin-right: 6px;
  vertical-align: middle;
}

/* Options */
.options { display: flex; flex-direction: column; gap: 8px; }

.option-wrap input { display: none; }

.option-label {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid rgba(201,168,76,0.28);
  background: rgba(255,255,255,0.32);
  cursor: pointer;
  font-size: 0.93rem;
  color: var(--text-dark);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-label:active { transform: scale(0.98); }

.opt-dot {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}

.option-wrap.checkbox .opt-dot { border-radius: 5px; }

.option-wrap input:checked + .option-label {
  background: rgba(201,168,76,0.18);
  border-color: var(--gold);
}

.option-wrap input:checked + .option-label .opt-dot {
  background: var(--gold);
  border-color: var(--gold-dark);
}

.option-wrap input:checked + .option-label .opt-dot::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
}

.option-wrap.checkbox input:checked + .option-label .opt-dot::after {
  content: '✓';
  font-size: 11px;
  color: #fff;
  border-radius: 0;
  background: none;
  font-weight: 700;
}

/* "Outro" text input */
.outro-field {
  margin-top: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
  font-family: 'Lato', sans-serif;
  font-size: 0.93rem;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: none;
}

.outro-field.show { display: block; }
.outro-field:focus {
  border-color: var(--gold-dark);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.18);
}

/* ══════════════════════════════════════
   PROGRESS DOTS
══════════════════════════════════════ */
.progress {
  display: flex;
  gap: 7px;
  justify-content: center;
  margin-bottom: 18px;
}

.progress-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(201,168,76,0.3);
  transition: all 0.3s var(--ease);
}

.progress-dot.on {
  background: var(--gold);
  width: 22px;
  border-radius: 4px;
}

/* ══════════════════════════════════════
   MODAL (bottom sheet cookie consent)
══════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-sheet {
  background: linear-gradient(170deg, #FDF8F0 0%, #F0E6C8 100%);
  border-radius: 24px 24px 0 0;
  padding: 10px 24px 40px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease);
  scrollbar-width: thin;
}

.modal-overlay.open .modal-sheet { transform: translateY(0); }

.modal-handle {
  width: 44px; height: 5px;
  background: var(--gold);
  border-radius: 3px;
  margin: 14px auto 18px;
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.modal-body {
  font-size: 0.87rem;
  line-height: 1.75;
  color: #444;
  margin-bottom: 18px;
}

.modal-body strong { color: var(--gold-dark); }

.modal-actions { display: flex; flex-direction: column; gap: 10px; }

.cookie-badge {
  display: inline-block;
  background: var(--gold-light);
  color: var(--gold-dark);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  margin-right: 4px;
}

/* ══════════════════════════════════════
   THANK YOU
══════════════════════════════════════ */
.thanks-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 10vw, 4rem);
  font-weight: 700;
  color: var(--dark);
  text-shadow: 2px 3px 12px rgba(255,255,255,0.6);
  text-align: center;
}

.thanks-sub {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--gold-dark);
  text-align: center;
  margin-top: 10px;
}

/* ══════════════════════════════════════
   ALREADY SUBMITTED
══════════════════════════════════════ */
.already-icon { font-size: 3.5rem; text-align: center; margin-bottom: 10px; }

/* ══════════════════════════════════════
   TERMS PAGE — text blocks
══════════════════════════════════════ */
.terms-section { margin-bottom: 12px; }
.terms-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  color: var(--gold-dark);
  margin-bottom: 5px;
}
.terms-section p, .terms-section li {
  font-size: 0.83rem;
  line-height: 1.7;
  color: #2C1A06;
}
.terms-section ul { padding-left: 18px; }

/* ══════════════════════════════════════
   FORM SUBMIT FEEDBACK
══════════════════════════════════════ */
.error-msg {
  background: rgba(160,30,30,0.12);
  border: 1px solid rgba(160,30,30,0.4);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.87rem;
  color: #8b1414;
  margin-bottom: 10px;
  display: none;
}
.error-msg.show { display: block; }

.loading-spinner {
  display: none;
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-spinner.show { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
