/**
 * @file
 * Styles for refactored CASCO insurance form with sidebar.
 */

/* ==================================
   Layout: Sidebar + Content
   ================================== */

.casco-wizard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.wizard-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ==================================
   Sidebar Styles
   ================================== */

.wizard-sidebar {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 1.5rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

.sidebar-summary {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-section {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
}

.sidebar-section legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: #555;
  padding: 0 0.5rem;
}

.sidebar-highlight {
  background: #e8f4fd;
  border-color: #0073e6;
}

.sidebar-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.sidebar-item .label {
  color: #666;
  font-weight: 500;
}

.sidebar-item .value {
  color: #333;
  font-weight: 600;
}

.sidebar-item.price .value {
  color: #0073e6;
  font-size: 1.1rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #0073e6, #00a3ff);
  transition: width 0.3s ease;
}

/* ==================================
   Content Area
   ================================== */

.wizard-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.step-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 1.5rem 0;
}

/* ==================================
   Step Indicator
   ================================== */

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.step-indicator .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  color: #999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: #0073e6;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(0, 115, 230, 0.2);
}

.step.completed .step-number {
  background: #28a745;
  color: #fff;
}

.step-label {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

.step.active .step-label {
  color: #0073e6;
  font-weight: 600;
}

.step-connector {
  height: 2px;
  background: #e0e0e0;
  flex: 1;
  margin: 0 0.5rem;
  align-self: start;
  margin-top: 20px;
}

.step-connector.completed {
  background: #28a745;
}

/* ==================================
   Form Fields
   ================================== */

.form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-item label {
  font-weight: 600;
  color: #333;
  margin-bottom: 0.5rem;
  display: block;
}

.form-item input[type="text"],
.form-item input[type="email"],
.form-item input[type="tel"],
.form-item input[type="number"],
.form-item input[type="date"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-item input:focus {
  border-color: #0073e6;
  outline: none;
}

.form-item .description {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Radio buttons */
.payment-method-radios {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.payment-method-radios label {
  display: flex;
  align-items: center;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.payment-method-radios label:hover {
  border-color: #0073e6;
  background: #f0f8ff;
}

.payment-method-radios input:checked + label {
  border-color: #0073e6;
  background: #e8f4fd;
}

/* Offers radios — 2-column grid */
.offers-radios {
  display: flex;
  flex-direction: column;
}

.offers-radios .form-radios,
.offers-radios .form-boolean-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .offers-radios .form-radios,
  .offers-radios .form-boolean-group {
    grid-template-columns: 1fr;
  }
}

.offers-radios .form-type-radio,
.offers-radios .form-type-boolean {
  margin: 0;
}

.offers-radios .form-type-radio input[type="radio"],
.offers-radios .form-type-boolean input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.offers-radios .form-type-radio label,
.offers-radios .form-type-boolean label,
.offers-radios .form-item__label {
  display: block;
  padding: 20px;
  border: 1px solid #E3E8EF;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin: 0;
  min-height: 100%;
  box-sizing: border-box;
}

.offers-radios .form-type-radio label:hover,
.offers-radios .form-type-boolean label:hover,
.offers-radios .form-item__label:hover {
  border-color: #0073e6;
}

.offers-radios .form-type-radio input[type="radio"]:checked + label,
.offers-radios .form-type-boolean input[type="radio"]:checked + label,
.offers-radios .form-item__label.selected {
  border-color: #0073e6;
  box-shadow: 0 0 0 1px #0073e6;
}

/* ==================================
   Offers Grid
   ================================== */

.offers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.offer-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
}

.offer-price {
  font-size: 2rem;
  font-weight: 700;
  color: #0073e6;
  margin-bottom: 0.5rem;
}

/* ==================================
   Offer Cards (inside radio labels)
   ================================== */

.offer-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.offer-card__header {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.offer-card__logo {
  max-height: 36px;
  max-width: 140px;
  object-fit: contain;
}

.offer-card__company-name {
  font-size: 16px;
  font-weight: 600;
  color: #1D1D1B;
}

.offer-card__benefits-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.offer-card__price {
  font-size: 20px;
  font-weight: 700;
  color: #10B981;
  margin-bottom: 12px;
}

.offer-card__benefits-title {
  font-size: 14px;
  font-weight: 700;
  color: #202939;
  line-height: 1.4;
}

.offer-card__benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.offer-card__benefits li {
  font-size: 14px;
  line-height: 1.5;
  color: #697586;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.offer-card__bullet {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  background-color: #10B981;
  display: inline-block;
  flex-shrink: 0;
  position: relative;
  top: 1px;
}

.offer-price .currency {
  font-size: 1rem;
  color: #666;
}

.offer-commission {
  font-size: 0.85rem;
  color: #666;
}

.offer-logo {
  margin-bottom: 0.75rem;
}

.offer-logo img {
  max-height: 50px;
  max-width: 100%;
  object-fit: contain;
}

/* ==================================
   Photos Grid
   ================================== */

.info-box {
  background: #e8f4fd;
  border: 2px solid #0073e6;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.info-box p {
  margin: 0.5rem 0;
  color: #0066cc;
}

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.photo-upload {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s ease;
}

.photo-upload:hover {
  border-color: #0073e6;
  background: #f0f8ff;
}

.photo-upload.has-photo {
  border-color: #28a745;
  border-style: solid;
  background: #f0fff4;
}

.photos-progress {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  color: #333;
}

/* ==================================
   Summary Sections
   ================================== */

.summary-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.summary-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
}

.summary-section legend {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  padding: 0 0.5rem;
}

.summary-highlight {
  background: #e8f4fd;
  border-color: #0073e6;
}

.summary-data {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item .label {
  font-weight: 600;
  color: #555;
}

.summary-item .value {
  color: #333;
  font-weight: 600;
}

.summary-item.price-item .value {
  font-size: 1.5rem;
  color: #0073e6;
}

/* Final Details */
.final-details-section {
  background: #fff;
  border: 2px solid #0073e6;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.confirmation-checkbox {
  margin: 1.5rem 0;
}

.confirmation-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 1rem;
}

.confirmation-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 0.2rem;
}

/* ==================================
   Form Actions
   ================================== */

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding-top: 1.5rem;
  border-top: 2px solid #e0e0e0;
}

.button {
  padding: 0.75rem 2rem;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  color: #333;
}

.button:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

.button--primary {
  background: #0073e6;
  border-color: #0073e6;
  color: #fff;
}

.button--primary:hover {
  background: #0066cc;
  border-color: #0066cc;
}

.button--submit {
  background: #28a745;
  border-color: #28a745;
}

.button--submit:hover {
  background: #218838;
  border-color: #218838;
}

/* ==================================
   Messages
   ================================== */

.messages {
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.messages--status {
  background: #d4edda;
  border: 2px solid #28a745;
  color: #155724;
}

.messages--error {
  background: #f8d7da;
  border: 2px solid #dc3545;
  color: #721c24;
}

.messages--warning {
  background: #fff3cd;
  border: 2px solid #ffc107;
  color: #856404;
}

/* ==================================
   Responsive Design
   ================================== */

@media (max-width: 1024px) {
  .wizard-layout {
    grid-template-columns: 1fr;
  }

  .wizard-sidebar {
    position: static;
    order: 2;
    margin-top: 2rem;
  }

  .wizard-content {
    order: 1;
  }
}

@media (max-width: 768px) {
  .casco-wizard-container {
    padding: 1rem 0.5rem;
  }

  .wizard-content {
    padding: 1.5rem 1rem;
  }

  .step-indicator {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .step-connector {
    display: none;
  }

  .offers-grid,
  .photos-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .button {
    width: 100%;
  }
}

/* ==================================
   Accessibility
   ================================== */

.button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #0073e6;
  outline-offset: 2px;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==================================
   Confirmation Page
   ================================== */

.success-title {
  color: #28a745;
  text-align: center;
}

.confirmation-container {
  text-align: center;
  padding: 2rem 0;
}

.success-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.success-checkmark {
  font-size: 3rem;
  color: #fff;
}

.confirmation-text {
  max-width: 500px;
  margin: 0 auto 2rem;
}

.confirmation-text p {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
  margin: 0.75rem 0;
}

.confirmation-text strong {
  color: #0073e6;
  font-size: 1.25rem;
}

.confirmation-container .details {
  text-align: left;
  max-width: 600px;
  margin: 2rem auto 0;
}

.confirmation-actions {
  justify-content: center;
  border-top: none;
  padding-top: 0;
}

.confirmation-actions .button {
  min-width: 200px;
}

/* ── Step 3: Offer banner ── */
.casco-section-title {
  font-size: 22px;
  font-weight: 700;
  color: #202939;
  margin: 0 0 20px;
}

.casco-offer-banner {
  border: 1px solid #E3E8EF;
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 24px;
}

.casco-offer-banner__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #10B981;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 16px;
  margin-bottom: 16px;
}

.casco-offer-banner__icon {
  font-size: 14px;
}

.casco-offer-banner__subtitle {
  color: #202939;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 4px;
}

.casco-offer-banner__price {
  color: #10B981;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}

.casco-offer-banner__description {
  color: #4B5565;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 20px;
}

.casco-offer-banner__info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #F5F7F9;
  border-radius: 8px;
  padding: 16px 20px;
  color: #697586;
  font-size: 13px;
  line-height: 1.5;
}

.casco-offer-banner__info-icon {
  font-size: 18px;
  color: #4B5565;
  flex-shrink: 0;
  margin-top: 1px;
}
