:root {
  --navy: #162b4b;
  --gold: #c2a159;
  --gold-light: #d4b876;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-900: #111827;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 1000px;
    transform: translateY(0);
  }
}

@keyframes checkPop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}

.animate-slideUp {
  animation: slideUp 0.4s ease-out;
}

.animate-fadeIn {
  animation: fadeIn 0.3s ease-out;
}

.animate-slideDown {
  animation: slideDown 0.4s ease-out forwards;
}

.section-reveal {
  animation: slideDown 0.4s ease-out;
}

.check-pop {
  animation: checkPop 0.3s ease;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;

  padding: 1rem 2rem;
  min-width: 160px;

  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;

  border-radius: 12px;
  border: 0;
  cursor: pointer;

  position: relative;
  overflow: hidden;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.2s ease;

  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn:focus {
  outline: none;
}

.btn:focus-visible {
  box-shadow:
    0 0 0 4px rgba(22, 43, 75, 0.12),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
  background: var(--gold);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  box-shadow:
    0 16px 25px -5px rgba(0, 0, 0, 0.15),
    0 10px 10px -5px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.08),
    0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--navy);
  border: 1px solid var(--gray-200);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--gray-200);
  transform: translateY(-1px);
  box-shadow:
    0 14px 20px -8px rgba(0, 0, 0, 0.14),
    0 8px 8px -6px rgba(0, 0, 0, 0.05);
}

.btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary:not(.btn),
.btn-primary:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.step-content.hidden {
  display: none;
}

.step-content.animate-fadeIn {
  will-change: transform, opacity;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  transition: background 0.15s ease;
  color: var(--gray-900);
}

.step-btn:hover {
  background: rgba(243, 244, 246, 0.7);
}

.step-connector {
  height: 2px;
  width: 48px;
  background: var(--gray-300);
  transition: background 0.2s ease;
}

.step-connector.is-complete {
  background: var(--navy);
}

.step-bubble {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid var(--gray-300);
  background: var(--gray-100);
  display: grid;
  place-items: center;
  position: relative;
  transition: all 0.2s ease;
}

.step-num {
  font-weight: 800;
  color: var(--gray-500);
}

.step-check {
  width: 20px;
  height: 20px;
  position: absolute;
  opacity: 0;
  color: #fff;
}

.step-bubble.is-active {
  background: var(--navy);
  border-color: var(--navy);
  box-shadow: 0 12px 18px -10px rgba(0, 0, 0, 0.35);
}

.step-bubble.is-active .step-num {
  color: #fff;
}

.step-bubble.is-complete {
  background: var(--navy);
  border-color: var(--navy);
}

.step-bubble.is-complete .step-num {
  opacity: 0;
}

.step-bubble.is-complete .step-check {
  opacity: 1;
}

.step-bubble.is-future {
  background: var(--gray-100);
  border-color: var(--gray-300);
}

.step-text {
  display: none;
}

@media (min-width: 640px) {
  .step-text {
    display: block;
    text-align: left;
  }
}

.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
}

.step-desc {
  font-size: 12px;
  color: var(--gray-500);
}

.header-middle {
  display: grid;
  align-items: center;
  grid-template-columns: auto auto;
  column-gap: 1.25rem;
  min-width: 0;
  justify-self: center;
}

.header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "left middle right";
  align-items: center;
  column-gap: 1rem;
}

.header-left {
  grid-area: left;
  justify-self: start;
  min-width: 0;
}

.header-logo {
  display: block;
  width: auto;
  height: auto;
  flex-shrink: 0;
  max-height: 40px;
  max-width: min(260px, 100%);
  object-fit: contain;
}

.header-right {
  grid-area: right;
  justify-self: end;
  min-width: 0;
}

.header-middle {
  grid-area: middle;
}

.header-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-width: 220px;
}

.step-text-inline {
  display: block;
  text-align: left;
  min-width: 150px;
}

.header-progress-wrap {
  width: min(200%, 320px);
  min-width: 260px;
}

.option-card,
.care-level-btn,
.care-grade-btn,
.form-filler-btn {
  color: var(--gray-900);
}

.option-card:hover,
.care-level-btn:hover,
.care-grade-btn:hover,
.form-filler-btn:hover {
  color: var(--gray-900);
}

.care-level-btn {
  background: #fff;
  border: 2px solid var(--gray-200);
  color: var(--gray-900);
}

.care-level-btn.bg-navy,
.care-level-btn.is-active {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: #fff !important;
}

/* Care grade buttons */
.care-grade-btn {
  background: #fff;
  border: 2px solid var(--gray-200);
  color: var(--gray-900);
}

.care-grade-btn.bg-navy,
.care-grade-btn.is-active {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: #fff !important;
}

.check-icon,
.check-icon-small {
  background: var(--gold) !important;
  color: #fff !important;
}

.option-card .icon-box {
  background: #fff;
  color: #9ca3af;
}

.option-card:hover .icon-box {
  background: var(--navy);
  color: #fff;
}

.option-card:hover div.w-16.h-16 {
  background: var(--navy) !important;
}

.option-card:hover div.w-16.h-16 svg {
  color: #fff !important;
}

.bg-navy {
  background: var(--navy) !important;
}

.border-navy {
  border-color: var(--navy) !important;
}

.bg-navy,
.bg-navy * {
  color: #fff !important;
}

.bg-navy svg {
  stroke: currentColor;
}

/* Header Progress Bar */
.journey-rail {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.journey-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #162b4b, #1e3a5f);
  border-radius: 999px;
  transition: width 0.45s ease;
}

.journey-marker {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #c2a159;
  box-shadow:
    0 8px 14px -10px rgba(0, 0, 0, 0.35),
    0 0 0 3px rgba(194, 161, 89, 0.22);
  transition: left 0.45s ease;
}

/* Compact form layout */
.form-card .step-content > .text-center.mb-8 {
  margin-bottom: 1.15rem !important;
}

.form-card .step-content > .text-center.mb-8 h1 {
  font-size: clamp(1.9rem, 2.5vw, 2.35rem) !important;
  margin-bottom: 0.3rem !important;
  line-height: 1.06;
}

.form-card .step-content > .mb-8,
.form-card .step-content .mb-8 {
  margin-bottom: 1.15rem !important;
}

.form-card .step-content .mb-6 {
  margin-bottom: 0.95rem !important;
}

.form-card .step-content .gap-8 {
  gap: 1.2rem !important;
}

.form-card .step-content .p-6 {
  padding: 1.1rem !important;
}

.form-card .step-content .py-4 {
  padding-top: 0.8rem !important;
  padding-bottom: 0.8rem !important;
}

.form-card .step-content .pt-4 {
  padding-top: 0.8rem !important;
}

.form-card .step-content .pb-3 {
  padding-bottom: 0.55rem !important;
}

.form-card .step-content .reason-option-btn,
.form-card .step-content .care-situation-btn {
  min-height: 132px;
  padding: 1rem !important;
}

.form-card .step-content .package-card label {
  padding: 1rem !important;
}

.form-card .step-content .package-card label.package-card-body {
  padding: 0 !important;
}

.package-card-option {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.package-card-option .package-card-body {
  flex: 1 1 auto;
  min-height: 0;
}

#step3 #packageSelectionSection .package-card-option {
  display: grid;
  grid-template-rows: minmax(2.55rem, auto) 1fr;
  align-items: stretch;
}

#step3 #packageSelectionSection .package-card-option .package-card-body {
  height: 100%;
}

.package-card-option .package-card-body.is-package-selected {
  border-color: #c2a159 !important;
  box-shadow:
    0 16px 26px -20px rgba(17, 24, 39, 0.35),
    0 0 0 2px rgba(194, 161, 89, 0.96);
}

.package-recommendation-badge {
  min-height: 2.55rem;
  margin: 0 0.65rem -2px;
  border-radius: 0.7rem 0.7rem 0 0;
  background-color: #c2a259;
  color: #fff;
  text-align: center;
  padding: 0.5rem 0.75rem;
  line-height: 1.15;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-card canvas#signatureCanvas1,
.form-card canvas#signatureCanvas2,
.form-card canvas#signatureCanvasHaus {
  height: 250px !important;
}

@media (max-width: 1023px) {
  .form-main {
    padding-top: 0.9rem !important;
    padding-bottom: 1.1rem !important;
  }

  .form-card .step-content .reason-option-btn,
  .form-card .step-content .care-situation-btn {
    min-height: 112px;
  }

  .package-recommendation-badge {
    min-height: 2.35rem;
    margin: 0 0.5rem -2px;
    font-size: 0.95rem;
    padding: 0.45rem 0.55rem;
  }
}

@media (min-width: 768px) {
  .package-card-option {
    min-height: 380px;
  }

  #step3 #packageSelectionSection .package-card-option {
    min-height: 410px;
  }

  .package-card-option .package-card-body > .p-6 {
    padding: 1.4rem !important;
  }
}

/* Glove size buttons */
.glove-btn {
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  border: 2px solid #c9a14a;
  background: #fff;
  color: #c9a14a;
  transition: all 150ms ease;
}

.glove-btn:hover {
  background: rgba(201, 161, 74, 0.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.glove-btn.is-selected {
  background: #c9a14a;
  color: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
}

/* Step 3 custom package mobile layout guards */
#step3,
#customPackageBuilder {
  overflow-x: hidden;
}

@media (max-width: 767px) {
  .header-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left right"
      "middle middle";
    row-gap: 0.45rem;
    column-gap: 0.55rem;
    align-items: center;
  }

  .header-left {
    align-self: center;
  }

  .header-middle {
    justify-self: stretch;
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.6rem;
    align-items: center;
  }

  .header-stepper {
    justify-content: flex-start;
  }

  .stepper-inline {
    gap: 0.55rem;
    min-width: 0;
  }

  .step-bubble {
    width: 38px;
    height: 38px;
  }

  .step-num {
    font-size: 1rem;
  }

  .step-text-inline {
    min-width: 0;
  }

  .step-title {
    font-size: 0.93rem;
    line-height: 1.1;
  }

  .step-desc {
    font-size: 0.77rem;
    line-height: 1.1;
  }

  .header-progress-wrap {
    width: 100%;
    min-width: 0;
  }

  .header-progress-wrap .text-xs {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    line-height: 1.15;
  }

  .journey-rail {
    height: 6px;
  }

  .journey-marker {
    width: 10px;
    height: 10px;
    box-shadow:
      0 6px 10px -9px rgba(0, 0, 0, 0.35),
      0 0 0 2px rgba(194, 161, 89, 0.24);
  }

  .header-logo {
    max-height: 34px;
    max-width: min(220px, calc(100vw - 90px));
    width: auto;
    height: auto;
    object-fit: contain;
  }

  #customPackageBuilder #careboxItemsList {
    overflow-x: hidden;
  }

  #customPackageBuilder [data-item-card] {
    width: 100%;
    max-width: 100%;
  }

  #customPackageBuilder .mobile-cart-inline-card {
    background: #162b4b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.75rem;
  }

  #customPackageBuilder .mobile-cart-inline-head {
    color: #ffffff;
  }

  #customPackageBuilder .mobile-cart-inline-items {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0.35rem;
  }

  #customPackageBuilder .mobile-cart-inline-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: #ffffff;
    border-bottom: 1px solid #dfe3ea;
  }

  #customPackageBuilder .mobile-cart-inline-item:nth-child(odd) {
    background: #f6f8fb;
  }

  #customPackageBuilder .mobile-cart-inline-item:last-child {
    border-bottom: 0;
  }

  #customPackageBuilder .mobile-cart-inline-item-name {
    color: #1c2b44;
    font-size: 0.95rem;
    line-height: 1.25;
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  #customPackageBuilder .mobile-cart-inline-item-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
  }

  #customPackageBuilder .mobile-cart-inline-item-qty {
    color: #2f8b45;
    font-size: 0.9rem;
    font-weight: 700;
  }

  #customPackageBuilder .mobile-cart-remove {
    background: transparent;
    border: 0;
    color: #dc3545;
    padding: 0;
    line-height: 1;
  }
}

@media (min-width: 540px) and (max-width: 767px) {
  #customPackageBuilder .mobile-cart-inline-card {
    padding: 0.9rem;
  }
}
