/* ===== KEYFRAMES ===== */
/* Energetische Push-Up Animation für Mobile - ohne Bounce */
@keyframes mobileSheetPushUp {
  0% {
    transform: translateY(100%);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Checkmark circle draw animation */
@keyframes drawCircle {
  0% {
    stroke-dashoffset: 158;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Checkmark path draw animation (staggered after circle) */
@keyframes drawCheck {
  0% {
    stroke-dashoffset: 50;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* Icon scale-in with slight bounce */
@keyframes successIconIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Success text fade-up */
@keyframes successTextFadeUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== NEWSLETTER BOTTOM SHEET ===== */

.newsletter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 8000;
  background: rgba(20, 52, 20, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(212, 170, 80, 0.45);
  border-radius: 18px 18px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 40px rgba(0, 0, 0, 0.4);
  will-change: transform;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.7s ease;
  opacity: 0;
  pointer-events: none;
}

/* Hidden until cookie consent is given */
.newsletter-sheet.ns-hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Collapsed peek state: handle strip visible */
.newsletter-sheet.ns-peek {
  transform: translateY(calc(100% - 56px));
  opacity: 1;
  pointer-events: auto;
  animation: none;
}

/* Expanded state */
.newsletter-sheet.ns-expanded {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* While dragging – no CSS transition */
.newsletter-sheet.ns-dragging {
  transition: none !important;
  animation: none !important;
}

/* Backdrop removed – background stays unchanged when sheet is open */

/* ---- Handle area (always visible) ---- */
.ns-handle-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 20px 8px;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}

.ns-handle-area:active {
  cursor: grabbing;
}

.ns-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  flex-shrink: 0;
  transition: background 0.2s ease, width 0.2s ease;
}

.ns-handle-area:active .ns-drag-handle {
  background: rgba(255, 255, 255, 0.55);
  width: 32px;
}

/* Label row: shown in collapsed/peek state, fades when expanded */
.ns-label-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.ns-label-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  flex-shrink: 0;
  color: #d4aa50;
  stroke: #d4aa50;
}

/* Fade label out when expanded */
.newsletter-sheet.ns-expanded .ns-label-row {
  opacity: 0;
  transform: translateY(4px);
}

/* ---- Form content area ---- */
.ns-content {
  padding: 0 20px 20px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.newsletter-sheet.ns-expanded .ns-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.ns-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.ns-subtitle {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.4;
}

.ns-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ns-email-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid rgba(34, 197, 94, 0.25);
  background: rgba(22, 58, 22, 0.7);
  color: #ffffff;
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s ease, background 0.2s ease,
              box-shadow 0.2s ease;
  -webkit-appearance: none;
}

.ns-email-input::placeholder {
  color: rgba(255, 255, 255, 0.38);
}

.ns-email-input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(22, 58, 22, 0.92);
}

/* Honeypot – invisible and out of tab order */
.ns-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.ns-submit-btn {
  width: 100%;
  padding: 13px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #d4aa50 0%, #b8903a 100%);
  color: #163a16;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  font-family: inherit;
  border: none;
  transition: background 0.2s ease, opacity 0.2s ease,
              transform 0.15s ease, box-shadow 0.2s ease;
}

.ns-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e0bb60 0%, #c9a04a 100%);
  box-shadow: 0 2px 14px rgba(212, 170, 80, 0.4);
}

.ns-submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.ns-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Feedback message */
.ns-message {
  margin: 4px 0 0;
  font-size: 0.84rem;
  line-height: 1.45;
  min-height: 1.2em;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  transition: opacity 0.25s ease;
}

.ns-message.ns-success {
  color: rgba(134, 239, 172, 0.95);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
  margin: 40px 0 0;
  padding: 20px 0;
}

.ns-message.ns-error {
  color: rgba(252, 165, 165, 0.95);
}

/* ===== Body scroll lock when sheet is open ===== */
body.ns-sheet-open {
  overflow: hidden;
}

/* ===== DESKTOP: center the sheet like the container ===== */
@media (min-width: 480px) {
  .newsletter-sheet {
    left: 50%;
    right: auto;
    width: 440px;
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }

  .newsletter-sheet.ns-peek {
    transform: translateX(-50%) translateY(calc(100% - 56px));
    opacity: 1;
    animation: none;
  }

  .newsletter-sheet.ns-expanded {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Mobile safe-area bottom */
@media (max-width: 479px) {
  .ns-content {
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ===== NOISE TEXTURE BACKGROUND (same as website body) ===== */

.newsletter-sheet::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("/files/images/noise-texture.png");
  background-size: 200px 200px;
  background-repeat: repeat;
  mix-blend-mode: overlay;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

/* Ensure all sheet content sits above texture layer */
.ns-handle-area,
.ns-content {
  position: relative;
  z-index: 1;
}

/* ===== SUCCESS STATE ===== */
/* Replaces form content at exact same position */
.ns-success-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 0 8px;
  opacity: 0;
}

.ns-success-state.ns-success-visible {
  display: flex;
  opacity: 1;
}

/* Checkmark icon container */
.ns-success-icon {
  margin-bottom: 16px;
}

.ns-checkmark {
  width: 56px;
  height: 56px;
  display: block;
}

.ns-checkmark-circle {
  stroke-dasharray: 158;
  stroke-dashoffset: 158;
  animation: drawCircle 0.5s ease-out forwards;
}

.ns-checkmark-path {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  animation: drawCheck 0.4s ease-out 0.35s forwards;
}

.ns-success-state.ns-success-visible .ns-checkmark {
  animation: successIconIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Success main text */
.ns-success-text {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(12px);
}

.ns-success-state.ns-success-visible .ns-success-text {
  animation: successTextFadeUp 0.4s ease-out 0.55s forwards;
}

/* Success subtext */
.ns-success-subtext {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 280px;
  opacity: 0;
  transform: translateY(12px);
}

.ns-success-state.ns-success-visible .ns-success-subtext {
  animation: successTextFadeUp 0.4s ease-out 0.7s forwards;
}

