/* Global Variables matching exact layout and color spec */
:root {
  --font-stack: system-ui, -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  
  --bg-base: #e8dcc4;            /* Warm sepia/cream base */
  --text-heading: #1a1a1a;       /* Near-black headings */
  --text-body: #4a4a4a;          /* Muted dark grey */
  --text-secondary: #6a6460;     /* Lighter grey for descriptions */
  --accent-maroon: #4a1e2e;      /* Dark maroon for badges and buttons */
  --accent-maroon-hover: #3d1a2a;
  
  --choice-bg: #d9d0c4;          /* Warm taupe/beige option fill */
  --choice-hover: #ccc3b7;       /* Slightly darker taupe on hover */
  --choice-selected: #c9c0b4;    /* Selected state */
  
  --border-color: rgba(74, 30, 46, 0.2);
  --border-focus: var(--accent-maroon);
  
  --error-color: #b91c1c;
  --error-bg: rgba(185, 28, 28, 0.07);
  
  --border-radius-choice: 8px;
  --transition-speed: 0.3s;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-base);
  /* Top of the page is slightly warmer sepia, grading into the base */
  background-image: linear-gradient(to bottom, rgba(235, 220, 183, 0.85) 0%, rgba(232, 220, 196, 0.75) 50%, rgba(232, 220, 196, 0.2) 100%);
  color: var(--text-body);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* --- Persistent Sepia-toned Football Goal Backdrop --- */
.app-bg-overlay {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/background.png');
  background-size: cover;
  background-position: center bottom;
  z-index: 0;
  /* Sharp, clearly visible, sepia-toned hero image */
  filter: sepia(0.35) contrast(1.05);
  pointer-events: none;
}

/* --- Progress Bar --- */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: rgba(26, 26, 26, 0.08);
  z-index: 100;
}
.progress-bar {
  height: 100%;
  background: var(--accent-maroon);
  transition: width 0.3s ease;
}

/* --- Main Layout Structure --- */
.main-content {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}

.form-container {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.step-slide {
  width: 100%;
  height: 100%;
  animation: slideIn var(--transition-speed) ease-out forwards;
  display: flex;
  flex-direction: column;
}

/* Transitions */
.step-slide.slide-out-left {
  animation: slideOutLeft var(--transition-speed) ease forwards;
}
.step-slide.slide-out-right {
  animation: slideOutRight var(--transition-speed) ease forwards;
}
.step-slide.slide-in-left {
  animation: slideInLeft var(--transition-speed) ease forwards;
}

/* --- Left-aligned, 40% width constrained content layout --- */
.welcome-layout, .question-container {
  width: 40vw;
  min-width: 320px;
  max-width: 40vw;
  margin-left: 10vw; /* 10% of viewport width */
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Intro Screen Positioning */
.welcome-layout {
  padding-top: 38vh; /* starts roughly 35-40% down the viewport */
}

/* Question Screen Positioning */
.question-container {
  padding-top: 9vh; /* starts roughly 8-10% from the top */
}

/* Split-pane layout for photo uploads (Screenshot 5) */
.split-layout-container {
  display: flex;
  width: 100%;
  height: 100%;
  padding-left: 10vw;
}
.split-image-panel {
  width: 40vw;
  max-width: 40vw;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-right: 48px;
}
.showcase-image {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.split-content-panel {
  width: 40vw;
  max-width: 40vw;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 9vh;
}

/* --- Intro Screen Elements --- */

.welcome-heading-wrapper {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-bottom: 24px;
}

/* Oversized opening quote mark styled exactly to specs */
.welcome-quote-glyph {
  font-family: Georgia, serif;
  font-size: 90px;
  line-height: 1;
  color: var(--text-heading);
  margin-right: 12px;
  margin-top: -18px; /* baseline aligned near the top of the heading */
  user-select: none;
  flex-shrink: 0;
}

.welcome-title {
  font-size: 26px;
  font-weight: 400;
  line-height: 34px;
  letter-spacing: -0.5px;
  color: var(--text-heading);
}

.welcome-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-body);
  margin-bottom: 24px;
}
.welcome-desc a {
  color: inherit;
  text-decoration: underline;
}

/* Continue Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-maroon);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: opacity 0.15s ease;
}
.btn-primary:hover {
  opacity: 0.9;
}
.btn-primary:active {
  opacity: 0.8;
}

/* --- Question Screen Elements --- */

.group-header-banner {
  display: flex;
  align-items: center;
  background-color: rgba(74, 30, 46, 0.05);
  border-bottom: 1px solid rgba(74, 30, 46, 0.1);
  padding: 10px 10vw;
  width: 100%;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-body);
}
.group-badge {
  background-color: var(--accent-maroon);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  margin-right: 8px;
}
.group-title {
  font-weight: 500;
}

.question-header-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  width: 100%;
}

/* Question numbering badge matching Continue button colour */
.question-badge {
  background-color: var(--accent-maroon);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin-right: 12px;
  margin-top: 4px;
  flex-shrink: 0;
}
.question-label {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-heading);
}

/* Required field asterisk styled in maroon */
.required-asterisk {
  color: var(--accent-maroon);
  margin-left: 3px;
  font-weight: 600;
}

.question-desc {
  font-size: 14px;
  font-style: italic;
  color: var(--text-secondary);
  margin-left: 34px;
  margin-bottom: 20px;
}

/* --- Input Fields --- */
.input-text-container {
  width: 100%;
  margin-left: 34px;
  margin-bottom: 24px;
}
.input-field {
  width: 100%;
  padding: 12px 0;
  font-size: 20px;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background-color: transparent;
  color: #8c6778; /* Soft maroon/burgundy text value */
  outline: none;
  transition: border-bottom-color 0.2s ease;
}
.input-field:focus {
  border-bottom-color: var(--border-focus);
}

.select-field {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='%234a1e2e' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 32px;
  cursor: pointer;
}
.select-field option {
  background-color: var(--bg-base);
  color: var(--text-heading);
}

/* Option Buttons list */
.choices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-left: 34px;
  margin-bottom: 24px;
}
.choice-btn {
  display: flex;
  align-items: center;
  background-color: var(--choice-bg);
  border: none;
  padding: 12px 16px;
  border-radius: var(--border-radius-choice);
  cursor: pointer;
  width: 100%; /* Spans full width of the left 40% column */
  text-align: left;
  outline: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-heading);
  transition: background-color 0.15s ease;
}
.choice-btn:hover {
  background-color: var(--choice-hover);
}
.choice-btn.selected {
  background-color: var(--choice-selected);
  box-shadow: inset 0 0 0 2px var(--accent-maroon);
}

/* Letter badge tinted to match the maroon number badge */
.choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background-color: rgba(74, 30, 46, 0.08);
  border: 1px solid rgba(74, 30, 46, 0.25);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 12px;
  color: var(--accent-maroon);
  flex-shrink: 0;
}
.choice-btn:hover .choice-key,
.choice-btn.selected .choice-key {
  background-color: var(--accent-maroon);
  color: #ffffff;
  border-color: var(--accent-maroon);
}

/* Contact fields list */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  margin-left: 34px;
  margin-bottom: 24px;
}
@media (min-width: 600px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
  .contact-grid .full-width {
    grid-column: span 2;
  }
}
.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.contact-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-heading);
}
.contact-input {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-bottom: 1px solid var(--border-color);
  background-color: transparent;
  font-size: 18px;
  outline: none;
  color: #8c6778;
  transition: border-bottom-color 0.2s ease;
}
.contact-input:focus {
  border-bottom-color: var(--border-focus);
}

.phone-input-wrapper {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}
.phone-flag-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-right: 8px;
  border-right: 1px solid rgba(74, 30, 46, 0.15);
  margin-right: 12px;
  font-size: 16px;
  cursor: pointer;
}
.phone-input-wrapper .contact-input {
  border: none;
  padding: 8px 0;
}
.phone-input-wrapper:focus-within {
  border-bottom-color: var(--border-focus);
}

/* File Upload zone */
.file-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(74, 30, 46, 0.25);
  padding: 32px;
  border-radius: 8px;
  cursor: pointer;
  background-color: var(--choice-bg);
  transition: background-color 0.2s ease;
  min-height: 160px;
  margin-left: 34px;
  width: calc(100% - 34px);
}
.file-dropzone:hover, .file-dropzone.dragover {
  background-color: var(--choice-hover);
}
.file-icon {
  margin-bottom: 12px;
  color: var(--accent-maroon);
  opacity: 0.65;
}
.file-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-heading);
  text-align: center;
}
.file-browse {
  color: var(--accent-maroon);
  font-weight: 600;
  text-decoration: underline;
  margin-top: 4px;
  display: block;
}

/* File Previews */
.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 34px);
  margin-left: 34px;
  margin-top: 12px;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.preview-info {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}
.preview-thumbnail {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.preview-doc-icon {
  width: 36px;
  height: 36px;
  background-color: rgba(26, 26, 26, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
}
.preview-name {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.preview-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--error-color);
  padding: 4px;
}

/* Error message banner */
.error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  margin-left: 34px;
  padding: 8px 12px;
  background-color: var(--error-bg);
  border-left: 3px solid var(--error-color);
  border-radius: 0 4px 4px 0;
  color: var(--error-color);
  font-size: 13px;
  font-weight: 500;
  animation: shake 0.3s ease;
}

/* --- Navigation Controls Footer --- */
.app-footer {
  padding: 24px 10vw; /* Aligned with left margin */
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: transparent;
  position: relative;
  z-index: 1;
}
.navigation-controls {
  display: flex;
  gap: 8px;
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-heading);
  transition: background-color 0.15s ease;
}
.nav-btn:hover:not(:disabled) {
  background-color: rgba(255, 255, 255, 0.7);
}
.nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.power-tag {
  font-size: 12px;
  color: var(--text-secondary);
}
.power-tag a {
  color: var(--text-heading);
  text-decoration: none;
  font-weight: 600;
}

/* --- Animations --- */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideOutLeft {
  to {
    opacity: 0;
    transform: translateY(-12px);
  }
}
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateY(12px);
  }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* --- intl-tel-input Overrides --- */
.iti {
  width: 100%;
  display: block;
}
.iti__flag-container {
  padding: 10px 0;
}
.iti__selected-flag {
  border-radius: 4px 0 0 4px;
}
.iti__country-list {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
