/* ============================================
   Glow Cycle Lab — Shared form error handler
   Used by: NDA, waitlist, beta, contact
   ============================================ */

.gcl-error {
  margin-top: 18px;
  padding: 20px 22px 20px 28px;
  background: linear-gradient(160deg, #fbe4e1 0%, #f6d2cf 100%);
  border: 1px solid rgba(160, 45, 60, 0.40);
  border-radius: 12px;
  position: relative;
  overflow: visible;
  box-shadow: 0 6px 20px rgba(160, 45, 60, 0.18);
  animation:
    gclErrorEntry 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both,
    gclErrorAttention 3.2s cubic-bezier(0.36, 0.07, 0.19, 0.97) 0.6s infinite;
}

.gcl-error::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  border-radius: 12px 0 0 12px;
  background: linear-gradient(180deg, #a02d3c 0%, #b44656 60%, #c8958a 100%);
  box-shadow: 0 0 12px rgba(160, 45, 60, 0.4);
}

@keyframes gclErrorEntry {
  0%   { opacity: 0; transform: translateX(0); }
  10%  { opacity: 1; transform: translateX(-14px); }
  25%  { transform: translateX(12px); }
  40%  { transform: translateX(-9px); }
  55%  { transform: translateX(7px); }
  70%  { transform: translateX(-4px); }
  85%  { transform: translateX(2px); }
  100% { transform: translateX(0); }
}

@keyframes gclErrorAttention {
  0%, 82%, 100% { transform: translateX(0); }
  85%           { transform: translateX(-10px); }
  88%           { transform: translateX(9px); }
  91%           { transform: translateX(-6px); }
  94%           { transform: translateX(4px); }
  97%           { transform: translateX(-2px); }
}

.gcl-error.attended {
  animation: gclErrorEntry 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

@media (prefers-reduced-motion: reduce) {
  .gcl-error,
  .gcl-error.attended {
    animation: gclErrorFade 0.3s ease-out both !important;
  }
  @keyframes gclErrorFade {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.gcl-error-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #a02d3c;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gcl-error-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a02d3c;
  box-shadow: 0 0 0 4px rgba(160, 45, 60, 0.20);
}

.gcl-error-message {
  font-size: 16px;
  line-height: 1.6;
  color: #5a3a3d;
  font-weight: 400;
  font-family: 'Crimson Pro', Georgia, serif;
}

.gcl-error-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.gcl-error-btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #e5a0b3, #c8958a);
  color: #fdf8f5;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(200, 149, 138, 0.35);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.gcl-error-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(200, 149, 138, 0.5);
}

.gcl-error-btn:active {
  transform: translateY(0);
}

.gcl-error-btn svg {
  width: 14px;
  height: 14px;
}

.gcl-error-btn.secondary {
  background: rgba(255, 255, 255, 0.9);
  color: #a02d3c;
  border: 1px solid rgba(160, 45, 60, 0.35);
  box-shadow: 0 2px 8px rgba(160, 45, 60, 0.12);
}

.gcl-error-btn.secondary:hover {
  background: #ffffff;
  border-color: #a02d3c;
  box-shadow: 0 4px 14px rgba(160, 45, 60, 0.2);
}

.gcl-error-details-toggle {
  margin-top: 14px;
  font-size: 12px;
  color: #a02d3c;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: rgba(160, 45, 60, 0.35);
  text-underline-offset: 3px;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.gcl-error-details-toggle:hover {
  opacity: 1;
}

.gcl-error-details-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 0.2s;
}

.gcl-error-details-toggle.open svg {
  transform: rotate(180deg);
}

.gcl-error-details-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
  margin-top: 0;
}

.gcl-error-details-wrapper.open {
  max-height: 200px;
  opacity: 1;
  margin-top: 12px;
}

.gcl-error-details {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11px;
  color: #5a3a3d;
  line-height: 1.8;
  user-select: all;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(160, 45, 60, 0.30);
  border-radius: 6px;
  padding: 10px 14px;
}

.gcl-error-details .field {
  color: #a02d3c;
  font-weight: 600;
}

.gcl-error-footnote {
  margin-top: 12px;
  font-size: 11px;
  font-style: italic;
  color: #8a5a60;
  text-align: center;
  line-height: 1.5;
  font-family: 'Crimson Pro', Georgia, serif;
}

@media (max-width: 480px) {
  .gcl-error-actions {
    flex-direction: column;
  }
  .gcl-error-btn {
    min-width: 0;
  }
}
