@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap");

:root {
  --primary-color: #111;
  --secondary-color: #fff;
  --accent-color: #ff6a00;
  --font-family: 'Montserrat', sans-serif;
  --radius: 6px;
  --figure-color: #ffffff;
  --figure-stroke: #000;  
}

/* Base Layout */
html, body {
  height: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--primary-color);

  margin: 0;
  min-height: 100vh;

  display: flex;
  justify-content: center;   /* horizontal only */
  align-items: flex-start;   /* top aligned */

  padding: 24px;
  overflow: auto;
}

/* Containers */
.content,
.form-container,
.result-container {
  width: 100%;
  max-width: 350px;
  text-align: center;
  padding: 2rem;
  border-radius: 20px;
  margin: 0 auto;
  margin-top: 20px;
}

/* Headings and text */
h1,
.headline {
  font-weight: 600;
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.headline {
  font-size: clamp(22px, 5vw, 26px);
}

p {
  color: #555;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Buttons */
.btn-fat,
.btn-dark,
.btn-outline-fat,
.btn-solid-fat {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  border: 2px solid transparent;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.btn-solid-fat,
.btn-dark {
  background: #000;
  color: var(--secondary-color);
  border-color: #000;
}

.btn-outline-fat,
.btn-outline-dark {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: #000;
  padding: 0.75rem 1rem;
}

.back-link {
  padding: 0.75rem;
  text-decoration: none;
  color: #000;
  display: inline-block;
  text-align: left !important;
}

/* ------------------------------
   FORM LABELS & INPUTS
   ------------------------------ */

/* Your original form label rules */
.form-label {
  text-align: left;
  display: block;
  font-weight: 500;
}

/* Your original input/select styling */
.form-control,
.form-select {
  padding: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.input-group .form-control,
.input-group .input-group-text {
  height: 48px;
  border-color: var(--primary-color);
}

.input-group .form-control {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border-right: none;
  box-shadow: none;
}

.input-group .input-group-text {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border-left: none;
}

/* ------------------------------
   OVERRIDES (fix theme centering)
   ------------------------------ */

/* Force all labels inside the form to be left-aligned */
/* Explicitly reset centering on the wrapper */
.form-container .py-3 {
    justify-content: flex-start;
    text-align: left !important;
}

.form-container form label {
  text-align: left !important;
}

/* Force all inputs/selects inside the form to be normal left layout */
.form-container form input,
.form-container form select {
  text-align: left !important;
}

/* Make sure the form itself is left-aligned even if parent is centered */
.form-container form {
  text-align: left !important;
}

.field-errors {
  color: #b00020;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  text-align: left;
}

/* Layout Grids */
.grid-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.grid-panel {
  flex: 1 1 0;
  text-align: left;
}

.grid-panel h5 {
  font-weight: 600;
  margin-bottom: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.grid button {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  background: var(--secondary-color);
  font-weight: 600;
  width: 100%;
}

.grid button.active {
  background: #000;
  color: var(--secondary-color);
}

/* ============================================
   SIMPLE TEXT TOGGLE WITH ARROW (SIR THEME)
   ============================================ */

.unit-toggle-simple {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 1rem;
  justify-content: center;
  font-family: 'Inter', sans-serif;
}

.unit-toggle-simple .unit-label {
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--primary-color);
  transition: color 0.25s ease;
}

.unit-toggle-simple .unit-label.active {
  color: var(--accent-color);
  font-weight: 600;
}

.unit-toggle-simple .unit-arrow {
  font-size: 1.4rem;
  font-weight: 700;
  transition: transform 0.25s ease, color 0.25s ease;
  color: var(--primary-color);
  display: inline-block;
}

/* Arrow flips direction when IN is active */
.unit-toggle-simple .unit-arrow.flip {
  transform: rotate(180deg);
}

/* Accent arrow when active */
.unit-toggle-simple .unit-arrow.active {
  color: var(--accent-color);
}

.how-to-measure-btn {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Remove default focus background / border */
.how-to-measure-btn:focus,
.how-to-measure-btn:active {
  outline: none;
  box-shadow: none;
  background: none;
}

/* Optional: accessible custom focus style */
.how-to-measure-btn:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.how-to-measure-toggle {
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.how-to-measure-toggle:hover,
.how-to-measure-toggle:focus {
  border: 1px solid #000;
  text-decoration: none;
}

.how-to-measure-toggle:focus-visible {
  outline: 2px solid #adb5bd;
  outline-offset: 2px;
}

.how-to-measure-toggle .arrow-icon {
  transition: transform 0.2s ease;
}

.how-to-measure-toggle[aria-expanded="true"] .arrow-icon {
  transform: rotate(180deg);
}

.measurement-guide {
  width: 100%;
  min-height: 210px; 
  background-image: url("/static/images/adult_seat.0acc02b7bca0.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center; /* horizontal + vertical center */
}

.measurement-image-shirt {
    width: 100%;
    height: 200px; /* adjust height as needed */
    background-image: url("/static/images/how-to-measure-neck.d25466c9214c.png");
    background-size: contain;   /* keeps aspect ratio */
    background-repeat: no-repeat;
    background-position: center;
    border-radius: 8px;         /* matches your rounded class */
}

/* Body type selection */
.body-options{
  display: flex;
  justify-content: center !important;
  gap: 16px;            /* space between options */
  flex-wrap: wrap;      /* if small screens */
}

.body-option{
  display: flex;        /* so span/input stack nicely if needed */
  flex-direction: column;
  align-items: center;
}

.body-image {
  width: 80px;
  height: 120px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 0.5rem;
  transition: transform 0.2s ease;
}

.body-option input[type="radio"]:checked + .body-image,
.body-option:hover .body-image {
  transform: scale(1.05);
}

/* Female body types */
.body-option.body-plum .body-image {
  background-image: url("/static/images/plum.6c673c48d82f.png");
}

.body-option.body-pear .body-image {
  background-image: url("/static/images/pear.87056b32d111.png");
}

.body-option.body-avocado .body-image {
  background-image: url("/static/images/avocado.384daae3a5a6.png");
}

/* Junior body type images */
.body-option.body-slim .body-image {
  background-image: url("/static/images/junior_slim.8c761ac7562b.png");
}

.body-option.body-regular .body-image {
  background-image: url("/static/images/junior_regular.152de764336c.png");
}

.body-option.body-round .body-image {
  background-image: url("/static/images/junior_round.394cb8919330.png");
}

/* Male body type images */
.body-option.body-papaya .body-image {
  background-image: url("/static/images/papaya.b5941217f7e4.png");
}

.body-option.body-banana .body-image {
  background-image: url("/static/images/banana.7fa5b7d609c1.png");
}

.body-option.body-avocado-male .body-image {
  background-image: url("/static/images/avocado_male.6d2e7b199c6e.png");
}

/* Size result view */
.highlight-text {
  font-weight: 600;
}

.secondary {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.75rem;
  text-align: left;
}

.size-scale {
  position: relative;
  max-width: 300px;
  margin: 20px auto 1.25rem;
}

/* Labels row layout */
.labels-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Side labels positioned over track edges */
.labels-row .side-size {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: #666;
}

.labels-row .side-size:first-child {
  left: 0%; /* same as start of track */
}

.labels-row .side-size:last-child {
  left: 100%; /* same as end of track */
}

/* Recommended (center) label stays normal */
.labels-row .rec-size {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* Track + pointer */
.size-scale .track {
  position: relative;
  height: 2px;
  background: #000;
  margin-top: 10px;
}

.size-scale .pointer {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  left: var(--offset, 50%);
  transform: translateX(-50%) rotate(180deg);
  transition: left 0.25s ease;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #000;
}

/* Loader */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.d-none { display: none !important; }

.spinner-container {
  position: relative;
  text-align: center;
  color: var(--secondary-color);
}

.spinner-logo img {
  max-width: 200px;
  margin: 0 auto;
}

.orbit-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbiting-dot {
  width: 12px;
  height: 12px;
  background-color: var(--primary-color, #94e6ed);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Logo */
.logo {
  width: 60px;
  height: 60px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin: 1rem auto 1rem;
  background-image: url("/static/images/logo_icon_blk.2c8bbd2b5073.png");
}

.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.7rem;   /* larger thumbs */
  color: #d8ddd8;         /* white thumbs */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.feedback-btn:hover {
  transform: scale(1.15);
  opacity: 0.9;
}

.feedback-btn.active#thumbs-up {
  color: #4caf50;  /* soft green highlight when clicked */
}

.feedback-btn.active#thumbs-down {
  color: #f44336;  /* soft red highlight when clicked */
}

/* Responsive */
@media (max-width: 576px) {
  .form-container { max-width: 100%; border-radius: 0; min-height: 100vh; }
  .grid-row { flex-direction: column; gap: 24px; }
  .grid-panel { width: 100%; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: stretch;
  }
  .d-flex.justify-content-between .btn {
    width: 100%;
  }
}
