/* ============================================================
   HUG Lüftungstechnik – Angebot Plugin Styles
   Author: Head and Code GmbH
   ============================================================ */

:root {
  --hug-teal:       #2abfbf;
  --hug-teal-dark:  #1fa8a8;
  --hug-teal-light: #e6f9f9;
  --hug-text:       #1a2733;
  --hug-muted:      #6b7a8a;
  --hug-border:     #d8e2ea;
  --hug-radius:     14px;
  --hug-shadow:     0 4px 24px rgba(0,0,0,.12);
}

/* ── Teaser ──────────────────────────────────────────────── */
.hug-teaser {
  display: flex;
  justify-content: center;
  padding: 8px;
}
.hug-teaser__inner {
  background: #fff;
  border: 1.5px solid var(--hug-border);
  border-radius: var(--hug-radius);
  box-shadow: 0 2px 16px rgba(42,191,191,.10);
  padding: 36px 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}
.hug-teaser__title {
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--hug-text);
  margin: 0 0 14px;
  line-height: 1.25;
}
.hug-teaser__title span {
  color: var(--hug-teal);
}
.hug-teaser__text {
  color: var(--hug-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 28px;
}
.hug-teaser__btn {
  display: inline-block;
  background: var(--hug-teal);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 32px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(42,191,191,.35);
  width: 100%;
  letter-spacing: .01em;
}
.hug-teaser__btn:hover,
.hug-teaser__btn:focus-visible {
  background: var(--hug-teal-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(42,191,191,.45);
  outline: none;
}

/* ── Overlay ─────────────────────────────────────────────── */
.hug-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,20,30,.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .25s;
}
.hug-overlay:not([hidden]) {
  opacity: 1;
}
.hug-overlay[hidden] {
  display: none !important;
}

/* ── Modal ───────────────────────────────────────────────── */
.hug-modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--hug-shadow);
  width: 100%;
  max-width: 620px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  padding: 40px 44px 36px;
  transform: translateY(20px);
  transition: transform .28s cubic-bezier(.22,.68,0,1.2);
  scrollbar-width: thin;
}
.hug-overlay:not([hidden]) .hug-modal {
  transform: translateY(0);
}

.hug-modal__close {
  position: absolute;
  top: 18px; right: 20px;
  background: #f0f4f8;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--hug-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.hug-modal__close:hover { background: #dde5ec; color: var(--hug-text); }

.hug-modal__header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}
.hug-modal__logo {
  flex-shrink: 0;
  margin-top: 2px;
}
.hug-modal__title {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 700;
  color: var(--hug-text);
  margin: 0;
  line-height: 1.35;
}

/* ── Form ────────────────────────────────────────────────── */
.hug-form__row { margin-bottom: 16px; }
.hug-form__row--2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.hug-form__group { display: flex; flex-direction: column; gap: 6px; }
.hug-form__group label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--hug-text);
}
.hug-form__group label span { color: var(--hug-teal); }

.hug-form__group input[type="text"],
.hug-form__group input[type="email"],
.hug-form__group input[type="tel"],
.hug-form__group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--hug-border);
  border-radius: 8px;
  font-size: .9375rem;
  color: var(--hug-text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
  appearance: none;
}
.hug-form__group input:focus,
.hug-form__group select:focus {
  outline: none;
  border-color: var(--hug-teal);
  box-shadow: 0 0 0 3px rgba(42,191,191,.18);
}
.hug-form__group input.hug-invalid {
  border-color: #e05555;
  box-shadow: 0 0 0 3px rgba(224,85,85,.12);
}

.hug-select-wrap { position: relative; }
.hug-select-wrap select { padding-right: 36px; }
.hug-select-arrow {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--hug-muted);
  font-size: .7rem;
}

/* ── Upload ──────────────────────────────────────────────── */
.hug-upload-area {
  border: 2px dashed var(--hug-border);
  border-radius: 10px;
  background: #fafcfe;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  position: relative;
}
.hug-upload-area:hover,
.hug-upload-area:focus-within {
  border-color: var(--hug-teal);
  background: var(--hug-teal-light);
}
.hug-upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.hug-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--hug-muted);
  pointer-events: none;
}
.hug-upload-label svg { color: var(--hug-teal); }
.hug-upload-label__main { font-weight: 600; color: var(--hug-text); font-size: .9375rem; }
.hug-upload-label__sub  { font-size: .8125rem; line-height: 1.5; }

.hug-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  justify-content: center;
}
.hug-preview__item {
  position: relative;
  width: 72px; height: 72px;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid var(--hug-border);
  flex-shrink: 0;
}
.hug-preview__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hug-preview__remove {
  position: absolute;
  top: 2px; right: 2px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ── Footer ──────────────────────────────────────────────── */
.hug-form__footer { margin-top: 24px; }
.hug-form__privacy { font-size: .8125rem; color: var(--hug-muted); margin: 0 0 14px; }
.hug-form__privacy a { color: var(--hug-teal); text-decoration: none; }
.hug-form__privacy a:hover { text-decoration: underline; }

.hug-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--hug-teal);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  padding: 15px 28px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(42,191,191,.35);
  letter-spacing: .01em;
}
.hug-submit-btn:hover:not(:disabled) {
  background: var(--hug-teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(42,191,191,.45);
}
.hug-submit-btn:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.hug-submit-btn__spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: hugSpin .7s linear infinite;
}
.hug-submit-btn.hug-loading .hug-submit-btn__spinner { display: block; }
.hug-submit-btn.hug-loading .hug-submit-btn__text { opacity: .75; }

@keyframes hugSpin { to { transform: rotate(360deg); } }

/* ── Messages ────────────────────────────────────────────── */
.hug-form__message {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9375rem;
}
.hug-form__message[hidden] { display: none; }
.hug-form__message.hug-msg--success {
  background: #e6f9f9; color: #1a7a7a;
  border: 1.5px solid #b2e8e8;
}
.hug-form__message.hug-msg--error {
  background: #fdeaea; color: #b33;
  border: 1.5px solid #f5b8b8;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 540px) {
  .hug-modal { padding: 28px 20px 24px; border-radius: 14px 14px 0 0; align-self: flex-end; max-height: 96vh; }
  .hug-overlay { align-items: flex-end; padding: 0; }
  .hug-form__row--2 { grid-template-columns: 1fr; }
  .hug-teaser__inner { padding: 28px 24px; }
}
