/* ==========================================================================
   CONFIGURABLE POLICIES SHOWER STYLES
   ========================================================================== */

.policy-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2xl);
  align-items: center;
  padding: clamp(3.5rem, 2.5rem + 3.5vw, 6rem) var(--space-md);
  position: relative;
  overflow: hidden;
  background-color: var(--bg-gradient-end);
}

@media (min-width: 992px) {
  .policy-container {
    display: grid;
    gap: var(--space-2xl);
    grid-template-columns: 38fr 62fr;
  }
}

/* Shifting Ambient Light Layer */
.policy-section-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  animation: ambient-glow-shift 30s ease-in-out infinite;
  will-change: background-image;
}

@keyframes ambient-glow-shift {

  0%,
  100% {
    background-image: radial-gradient(circle at 20% 30%, rgba(219, 234, 254, 0.22) 0%, transparent 60%);
  }

  33% {
    background-image: radial-gradient(circle at 80% 40%, rgba(219, 234, 254, 0.18) 0%, transparent 65%);
  }

  66% {
    background-image: radial-gradient(circle at 40% 80%, rgba(219, 234, 254, 0.22) 0%, transparent 60%);
  }
}

/* ==========================================================================
   LEFT MARKETING CONTENT
   ========================================================================== */

.policy-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  position: relative;
  z-index: 2;
}

.policy-badge {
  display: inline-flex;
  align-items: center;
  /* background: var(--glass-bg); */
  /* border: 1px solid var(--glass-border); */
  /* border-radius: 9999px; */
  /* padding: 6px 14px; */
  margin-bottom: var(--space-md);
  transition: border-color var(--transition-smooth), background-color var(--transition-smooth);
}

/* .policy-badge:hover {
  border-color: var(--glass-border-hover);
  background-color: var(--glass-bg-hover);
} */

.policy-badge-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--accent-orange);
  margin-right: 8px;
  flex-shrink: 0;
  display: block;
  border: 3px solid #fff;
  box-shadow: 0 0 0px 2px var(--navy-900);
}

.policy-badge-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1;
}

.policy-headline {
  margin-bottom: var(--space-md);
  color: var(--color-black);
  font-weight: 500;
}

.policy-desc {
  color: var(--navy-800);
  margin-bottom: var(--space-xl);
  max-width: 500px;
}

/* ==========================================================================
   RIGHT PREMIUM CONFIGURATION DASHBOARD
   ========================================================================== */

.policy-card-parallax {
  width: 100%;
  z-index: 2;
  position: relative;
  transition: transform 150ms ease-out;
  will-change: transform;
}

.policy-card {
  width: 100%;
  background: linear-gradient(135deg, #09112F 0%, #152453 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: var(--space-lg);
  box-shadow:
    0 30px 60px -15px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  cursor: pointer;
  outline: none;
  transition:
    transform 350ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 350ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

.policy-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.policy-card:focus-visible {
  outline: 2px solid var(--accent-orange);
  outline-offset: 4px;
}

/* Card Top Row */
.policy-top-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: var(--space-md);
}

.policy-journal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-orange);
}

.policy-journal-title {
  font-size: clamp(0.938rem, 0.92rem + 0.09vw, 1rem);
  /* ~15px -> 16px */
  font-weight: 600;
  color: #FFFFFF;
  flex-grow: 1;
}

.policy-editable-label {
  font-size: 0.813rem;
  font-weight: 700;
  color: var(--accent-orange);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  animation: editable-pulse 7s ease-in-out infinite;
  display: inline-block;
}

@keyframes editable-pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.04);
    opacity: 0.8;
  }
}

/* Card Middle Layout */
.policy-middle-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-xl);
  align-items: center;
  width: 100%;
}

@media (min-width: 768px) {
  .policy-middle-area {
    grid-template-columns: 35fr 65fr;
  }
}

/* Curved Arrow SVG drawing */
.policy-arrow-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
}

.policy-arrow-svg {
  width: 100%;
  max-width: 170px;
  height: auto;
  color: rgba(255, 255, 255, 0.05);
  /* initial static overlay */
  transform-origin: center;
  will-change: transform;
}

.policy-arrow-svg.floating {
  animation: arrow-premium-float 5s ease-in-out infinite;
}

@keyframes arrow-premium-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(0.5deg);
  }
}

.arrow-line {
  stroke-dasharray: 220;
  stroke-dashoffset: 220;
  stroke: rgba(255, 255, 255, 0.05);
}

.arrow-head {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  stroke: rgba(255, 255, 255, 0.05);
}

/* Animating drawings once triggered */
.start-animation .arrow-line {
  stroke: rgba(255, 255, 255, 0.15);
  animation: draw-arrow-line 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.start-animation .arrow-head {
  stroke: rgba(255, 255, 255, 0.15);
  animation: draw-arrow-head 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.2s forwards;
}

@keyframes draw-arrow-line {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes draw-arrow-head {
  to {
    stroke-dashoffset: 0;
  }
}

/* Progress rows */
.policy-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

.policy-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.policy-row.animate {
  opacity: 1;
  transform: translateY(0);
}

.policy-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.policy-row-label {
  font-size: var(--font-small);
  font-weight: 500;
  color: var(--text-secondary);
  transition: transform 250ms ease, color 250ms ease;
  transform-origin: left;
}

.policy-row:hover .policy-row-label {
  transform: translateX(2px);
  color: #FFFFFF;
}

.policy-value {
  font-size: 0.813rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 500ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.policy-row.animate .policy-value {
  opacity: 1;
  transform: translateY(0);
}

/* Progress tracks & fills */
.policy-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.policy-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transform: scaleX(0);
  transform-origin: left;
  transition:
    transform 1000ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 250ms ease;
  position: relative;
  box-shadow: 0 0 10px var(--glow-color);
  will-change: transform;
}

.policy-row.animate .policy-progress-fill {
  /* transform: scaleX(1); */
  transform: scaleX(var(--target-scale));
}

.policy-row:hover .policy-progress-fill {
  filter: brightness(1.15) saturate(1.1);
}

/* Gradient colors per row */
.policy-row[data-row="0"] .policy-progress-fill {
  background: linear-gradient(to right, #3B82F6, #06B6D4);
  --glow-color: rgba(6, 182, 212, 0.3);
}

.policy-row[data-row="1"] .policy-progress-fill {
  background: linear-gradient(to right, #3B82F6, #F97316);
  --glow-color: rgba(249, 115, 22, 0.3);
}

.policy-row[data-row="2"] .policy-progress-fill {
  background: linear-gradient(to right, #3B82F6, #8B5CF6);
  --glow-color: rgba(139, 92, 246, 0.3);
}

.policy-row[data-row="3"] .policy-progress-fill {
  background: linear-gradient(to right, #3B82F6, #EAB308);
  --glow-color: rgba(234, 179, 8, 0.3);
}

/* Subtle Shimmer highlight sweep once reaching final value */
.policy-progress-fill::before {
  /* content: ''; */
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  will-change: transform;
}

.policy-row.shimmer .policy-progress-fill::before {
  animation: shimmer-sweep 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes shimmer-sweep {
  to {
    transform: translateX(100%);
  }
}

/* Subtle AI scanning sweep highlight */
.policy-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0);
  transition: box-shadow 300ms ease;
  will-change: transform, box-shadow;
  animation: scan-sweep-pulse 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* .policy-row.scanning .policy-progress-fill::after {
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
  animation: scan-sweep-pulse 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
} */

@keyframes scan-sweep-pulse {
  0% {
    transform: translateX(-100%);
  }

  50% {
    transform: translateX(100%);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM OVERRIDES
   ========================================================================== */

@media (max-width: 991px) {

  /* Reduce layout margins on tablet viewports */
  .policy-section {
    gap: var(--space-xl);
  }
}

@media (max-width: 767px) {
  .policy-middle-area {
    grid-template-columns: minmax(0, 1fr);
  }

  .policy-arrow-container {
    display: none;
    /* Hide decorative arrow on small mobile layouts to save vertical space */
  }

  .policy-row {
    opacity: 1 !important;
    transform: none !important;
  }

  .policy-value {
    opacity: 1 !important;
    transform: none !important;
  }

  .policy-progress-fill {
    transform: scaleX(1) !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  .policy-section-glow,
  .policy-editable-label,
  .policy-arrow-svg,
  .policy-card,
  .policy-card-parallax,
  .policy-row,
  .policy-value,
  .policy-progress-fill,
  .policy-progress-fill::before,
  .policy-progress-fill::after,
  .policy-row-label {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }

  .arrow-line,
  .arrow-head {
    stroke-dashoffset: 0 !important;
    stroke: rgba(255, 255, 255, 0.15) !important;
  }
}