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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

/* Side-by-side layout */
.layout {
  display: flex;
  align-items: stretch;
  gap: 0;
  max-width: 960px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.hero-image {
  flex: 0 0 420px;
  min-height: 0;
  background: #F1EFF0;
}

.hero-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: top;
  display: block;
}

.container {
  flex: 1;
  max-width: 480px;
  width: 100%;
  padding: 40px 28px 40px 36px;
}

/* Logo */
.logo {
  text-align: center;
  margin-bottom: 24px;
}

.logo img {
  max-width: 140px;
  height: auto;
}

/* Order Banner */
.order-banner {
  background: #f0f7f0;
  border: 1px solid #c3e6c3;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 0.95rem;
  color: #2d6a2d;
}

/* Error Banner */
.error-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
  font-size: 0.95rem;
  color: #991b1b;
  line-height: 1.5;
}

header {
  text-align: center;
  margin-bottom: 32px;
}

h1 {
  font-size: 1.8rem;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.subtitle {
  color: #888;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.toggle-group {
  display: flex;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  background: #fff;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: #666;
}

.toggle-btn:hover {
  border-color: #999;
}

.toggle-btn.active {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
}

input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

input[type="number"]:focus {
  outline: none;
  border-color: #1a1a1a;
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-primary:hover {
  background: #333;
}

.result {
  text-align: center;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid #eee;
}

.result.hidden {
  display: none;
}

.result h2 {
  font-size: 1.1rem;
  color: #888;
  font-weight: 500;
  margin-bottom: 16px;
}

.size-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #1a1a1a;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 16px;
}

#result-details {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.size-table-preview {
  margin-bottom: 24px;
  overflow-x: auto;
}

.size-table-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.size-table-preview th,
.size-table-preview td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
}

.size-table-preview th {
  font-weight: 600;
  color: #888;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.size-table-preview .highlight {
  background: #f0f7f0;
  font-weight: 600;
}

.size-table-preview .your-value {
  color: #1a1a1a;
  font-weight: 700;
}

/* Field Validation Errors */
.field-error {
  display: block;
  color: #991b1b;
  font-size: 0.85rem;
  margin-top: 6px;
  font-weight: 500;
}

.field-error.hidden {
  display: none;
}

input[type="number"].input-error {
  border-color: #ef4444;
}

/* Confirm Button */
.btn-confirm {
  display: inline-block;
  padding: 14px 32px;
  background: #2d6a2d;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-width: 200px;
}

.btn-confirm:hover {
  background: #245a24;
}

.btn-confirm:disabled {
  background: #999;
  cursor: not-allowed;
}

/* API Error */
.api-error {
  color: #991b1b;
  font-size: 0.9rem;
  margin-top: 12px;
}

/* Confirmation Screen */
.confirmation-screen {
  text-align: center;
  padding: 40px 0;
}

.confirmation-screen.hidden {
  display: none;
}

.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #2d6a2d;
  color: #fff;
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.confirmation-screen h2 {
  font-size: 1.5rem;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.confirmation-screen p {
  color: #666;
  font-size: 1rem;
  line-height: 1.6;
}

.confirmation-note {
  margin-top: 24px;
  color: #999 !important;
  font-size: 0.9rem !important;
}

/* Suit Stepper */
.suit-stepper {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 0.95rem;
  color: #4338ca;
}

.suit-stepper.hidden {
  display: none;
}

/* Saved Suit Banner */
.suit-saved-banner {
  background: #f0f7f0;
  border: 1px solid #c3e6c3;
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 0.9rem;
  color: #2d6a2d;
  font-weight: 500;
}

.suit-saved-banner.hidden {
  display: none;
}

.measurements {
  margin-top: 8px;
}

.unit-label {
  font-weight: 400;
  color: #999;
}

.hidden {
  display: none;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
    max-width: 480px;
  }

  .hero-image {
    flex: none;
    overflow: hidden;
    background: transparent;
    aspect-ratio: 1071 / 1271;
  }

  .hero-image img {
    width: 100%;
    height: auto;
    display: block;
  }

  .container {
    padding: 28px 24px;
    margin-top: -60px;
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(255,255,255,0.85) 0%, rgba(255,255,255,1) 80px);
    border-radius: 16px 16px 0 0;
  }

  .logo {
    margin-bottom: 16px;
  }

  header {
    margin-bottom: 24px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .form-group {
    margin-bottom: 16px;
  }

  .btn-primary {
    padding: 12px;
    font-size: 1rem;
  }
}

@media (max-width: 500px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .layout {
    border-radius: 0;
    box-shadow: none;
  }

  .container {
    padding: 20px 16px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .logo img {
    max-width: 110px;
  }

  .toggle-btn {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  input[type="number"] {
    padding: 10px 14px;
  }

  .size-table-preview table {
    font-size: 0.75rem;
  }

  .size-table-preview th,
  .size-table-preview td {
    padding: 6px 6px;
  }
}
