/* =============================================================
   Newsletter Section
   @property --shine-pos and @keyframes shine-travel are defined
   in main.css (loaded before this file).
   ============================================================= */

.newsletter-section {
  background: linear-gradient(135deg, #162e4e 0%, #1E3A5F 60%, #243f6a 100%);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
  margin-top: 0;
  margin-block-start: 0;
}

.newsletter-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 80% at 0% 50%,  rgba(212,168,67,.07) 0%, transparent 65%),
    radial-gradient(ellipse 35% 60% at 100% 50%, rgba(178,34,52,.06)  0%, transparent 65%);
  pointer-events: none;
}

/* ── Layout ───────────────────────────────────────────────── */

.newsletter-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-3xl);
}

/* ── Left: text ───────────────────────────────────────────── */

.newsletter-text {
  flex: 0 0 auto;
  max-width: 360px;
}

.newsletter-title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: #fff !important;
  margin-bottom: var(--space-sm);
  line-height: var(--line-height-tight);
}

.newsletter-desc {
  font-size: var(--font-size-base);
  color: rgba(255,255,255,.72);
  line-height: var(--line-height-normal);
  margin: 0 0 var(--space-sm);
}

.newsletter-privacy {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,.38);
  margin: 0;
}

/* ── Right: form wrapper with traveling golden ring ───────── */

.newsletter-form-wrap {
  flex: 1 1 auto;
  position: relative;
  border-radius: calc(var(--radius-xl) + 2px);
  box-shadow:
    0 0 0 1.5px rgba(212,168,67,.22),
    0 8px 32px rgba(0,0,0,.30),
    0 0 40px rgba(212,168,67,.07);
}

/* Traveling golden ring */
.newsletter-form-wrap::before {
  content: '';
  position: absolute;
  inset: -1.5px;
  border-radius: calc(var(--radius-xl) + 3px);
  padding: 1.5px;
  background: conic-gradient(
    from var(--shine-pos, 0deg),
    rgba(212,168,67,0.18)    0deg,
    rgba(212,168,67,0.18)  275deg,
    rgba(212,168,67,0.55)  305deg,
    rgba(255,248,180,0.90) 325deg,
    rgba(255,255,255,0.96) 336deg,
    rgba(255,248,180,0.90) 347deg,
    rgba(212,168,67,0.18)  360deg
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: shine-travel 8s linear infinite;
  pointer-events: none;
  z-index: 3;
}

.newsletter-form-inner {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-xl);
  background: rgba(14, 25, 40, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px;
  overflow: hidden;
}

/* Inner glow */
.newsletter-form-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(212,168,67,.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Form — single row ────────────────────────────────────── */

.nl-form {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nl-input {
  flex: 1 1 0;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  background: rgba(255,255,255,.09);
  border: 1.5px solid rgba(255,255,255,.20);
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  transition: border-color .2s, background .2s;
}

.nl-input::placeholder {
  color: rgba(255,255,255,.42);
}

.nl-input:focus {
  outline: none;
  border-color: var(--color-accent);
  background: rgba(255,255,255,.13);
}

/* Gold subscribe button */
.nl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 40px;
  padding: 0 20px;
  background: var(--color-accent);
  color: #1E3A5F;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 700;
  letter-spacing: .03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, box-shadow .2s, transform .15s;
  box-shadow: 0 0 16px rgba(212,168,67,.35), 0 2px 8px rgba(0,0,0,.20);
}

.nl-btn:hover:not(:disabled) {
  background: #c49328;
  color: #fff;
  box-shadow: 0 0 28px rgba(212,168,67,.60), 0 4px 14px rgba(0,0,0,.25);
  transform: translateY(-1px);
}

.nl-btn:disabled,
.nl-btn.is-loading {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

/* Feedback message */
.nl-message {
  position: relative;
  z-index: 1;
  min-height: 0;
  font-size: var(--font-size-xs);
  font-weight: 600;
  margin-top: 6px;
  transition: opacity .2s;
}

.nl-message:empty { display: none; }

.nl-message--success { color: #6ee7b7; }
.nl-message--error   { color: #fca5a5; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 900px) {
  .newsletter-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xl);
  }

  .newsletter-text  { max-width: 100%; }
  .newsletter-form-wrap { width: 100%; }
}

@media (max-width: 540px) {
  .newsletter-form-inner { padding: 12px; }

  .nl-form { flex-wrap: wrap; }

  .nl-input {
    flex: 1 1 120px;
  }

  .nl-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ── Dark mode ────────────────────────────────────────────── */

html[data-theme="dark"] .newsletter-section {
  background: linear-gradient(135deg, #0A1520 0%, #0D1A28 60%, #0F1F35 100%);
}

html[data-theme="dark"] .newsletter-form-inner {
  background: rgba(6, 13, 22, 0.85);
}
