/* ============================================================================
   The Hellenic Harvest — Email Opt-in Popup (self-contained plugin)
   Namespaced under .hh-optin* so it can drop into any page without clashes.
   ========================================================================== */
.hh-optin,
.hh-optin * { box-sizing: border-box; }

.hh-optin {
  /* local tokens (mirror the site brand) */
  --hh-bg:        #0E1220;
  --hh-surface:   #161B2E;
  --hh-surface-2: #1B2138;
  --hh-gold:      #C9A24B;
  --hh-gold-soft: #E4C97E;
  --hh-text:      #F4F1EA;
  --hh-muted:     #A7ADBE;
  --hh-faint:     #6E7488;
  --hh-border:    rgba(201, 162, 75, 0.25);
  --hh-border-soft: rgba(244, 241, 234, 0.10);
  --hh-danger:    #E5736B;
  --hh-success:   #7FC9A4;
  --hh-emerald:   rgba(30, 90, 70, 0.55);
  --hh-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --hh-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --hh-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  font-family: var(--hh-body);
}

/* Hidden by default; JS adds .hh-open */
.hh-optin[hidden] { display: none; }

/* Scrim */
.hh-optin__scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 300ms var(--hh-ease);
}
.hh-optin.hh-open .hh-optin__scrim { opacity: 1; }

/* Dialog */
.hh-optin__dialog {
  position: relative;
  width: min(100%, 460px);
  background:
    radial-gradient(120% 80% at 80% -10%, var(--hh-emerald), transparent 55%),
    linear-gradient(180deg, var(--hh-surface-2), var(--hh-surface));
  border: 1px solid var(--hh-border);
  border-radius: 18px;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  color: var(--hh-text);
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 340ms var(--hh-ease), opacity 340ms var(--hh-ease);
  overflow: hidden;
}
.hh-optin.hh-open .hh-optin__dialog { transform: none; opacity: 1; }

/* faint meander frame */
.hh-optin__dialog::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--hh-border-soft);
  border-radius: 12px;
  pointer-events: none;
}

/* Close button */
.hh-optin__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--hh-border-soft);
  border-radius: 50%;
  color: var(--hh-muted);
  cursor: pointer;
  transition: color 200ms var(--hh-ease), border-color 200ms var(--hh-ease), transform 200ms var(--hh-ease);
  touch-action: manipulation;
  z-index: 2;
}
.hh-optin__close:hover { color: var(--hh-gold-soft); border-color: var(--hh-gold); transform: rotate(90deg); }

/* Emblem */
.hh-optin__emblem {
  margin: 0 auto 1rem;
  display: block;
  width: 84px;
  height: 84px;
  object-fit: contain;
  border-radius: 50%;
}

.hh-optin__eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--hh-gold);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.hh-optin__title {
  font-family: var(--hh-head);
  font-weight: 600;
  font-size: clamp(1.6rem, 1.3rem + 1.6vw, 2.1rem);
  line-height: 1.12;
  margin: 0 0 0.75rem;
}
.hh-optin__title .hh-accent { color: var(--hh-gold-soft); font-style: italic; }
.hh-optin__after-discount { margin-left: 0.22em; }
.hh-optin__sub {
  color: var(--hh-muted);
  font-size: 0.98rem;
  line-height: 1.6;
  margin: 0 auto 1.5rem;
  max-width: 34ch;
}

/* Form */
.hh-optin__form { display: block; text-align: left; }
.hh-optin__label {
  display: block;
  font-size: 0.82rem;
  color: var(--hh-muted);
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.hh-optin__input {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.1rem;
  background: var(--hh-bg);
  border: 1px solid var(--hh-border-soft);
  border-radius: 999px;
  color: var(--hh-text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 200ms var(--hh-ease), box-shadow 200ms var(--hh-ease);
}
.hh-optin__input::placeholder { color: var(--hh-faint); }
.hh-optin__input:focus-visible {
  outline: none;
  border-color: var(--hh-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 75, 0.22);
}
.hh-optin__input[aria-invalid="true"] { border-color: var(--hh-danger); }

.hh-optin__submit {
  width: 100%;
  min-height: 50px;
  margin-top: 0.85rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hh-gold-soft), var(--hh-gold));
  color: #241a06;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 18px 40px -18px rgba(201, 162, 75, 0.5);
  transition: transform 200ms var(--hh-ease), background-color 200ms var(--hh-ease);
  touch-action: manipulation;
}
.hh-optin__submit:hover { transform: translateY(-2px); background: var(--hh-gold-soft); }
.hh-optin__submit:active { transform: translateY(0) scale(0.99); }
.hh-optin__submit[disabled] { opacity: 0.7; cursor: default; transform: none; }

.hh-optin__msg {
  min-height: 1.2em;
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
  text-align: center;
}
.hh-optin__msg.hh-error   { color: var(--hh-danger); }
.hh-optin__msg.hh-success { color: var(--hh-success); }

.hh-optin__fine {
  color: var(--hh-faint);
  font-size: 0.74rem;
  line-height: 1.5;
  margin: 1rem 0 0;
  text-align: center;
}
.hh-optin__decline {
  display: inline;
  background: none;
  border: none;
  color: var(--hh-faint);
  font-family: inherit;
  font-size: 0.74rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}
.hh-optin__decline:hover { color: var(--hh-muted); }

/* ---- Success state ---- */
.hh-optin__success { display: none; text-align: center; }
.hh-optin.hh-done .hh-optin__form,
.hh-optin.hh-done .hh-optin__sub,
.hh-optin.hh-done .hh-optin__fine { display: none; }
.hh-optin.hh-done .hh-optin__success { display: block; }

.hh-optin__check {
  width: 58px; height: 58px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(127, 201, 164, 0.12);
  border: 1px solid rgba(127, 201, 164, 0.4);
  color: var(--hh-success);
}
.hh-optin__badge {
  display: inline-block;
  margin: 1.25rem auto 0.25rem;
  padding: 0.6rem 1.5rem;
  background: var(--hh-bg);
  border: 1px dashed var(--hh-gold);
  border-radius: 999px;
  color: var(--hh-gold-soft);
  font-family: var(--hh-head);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hh-optin__coupon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1.25rem auto 0.5rem;
  max-width: 320px;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  background: var(--hh-bg);
  border: 1px dashed var(--hh-gold);
  border-radius: 14px;
}
.hh-optin__code {
  font-family: var(--hh-head);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--hh-gold-soft);
}
.hh-optin__copy {
  flex: none;
  min-height: 40px;
  padding: 0 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--hh-gold-soft), var(--hh-gold));
  color: #241a06;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 200ms var(--hh-ease);
  touch-action: manipulation;
}
.hh-optin__copy:hover { transform: translateY(-1px); }
.hh-optin__copy.hh-copied { background: var(--hh-success); color: #06231a; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hh-optin__scrim,
  .hh-optin__dialog { transition: opacity 120ms linear; }
  .hh-optin__dialog { transform: none; }
  .hh-optin.hh-open .hh-optin__dialog { transform: none; }
  .hh-optin__close:hover { transform: none; }
  .hh-optin__submit:hover,
  .hh-optin__copy:hover { transform: none; }
}

/* Small screens */
@media (max-width: 480px) {
  .hh-optin__dialog { padding: 2.25rem 1.25rem 1.5rem; border-radius: 16px; }
  .hh-optin__coupon { flex-direction: column; padding: 1rem; }
  .hh-optin__copy { width: 100%; }
}
