/**
 * Barao Popup – Frontend Styles
 * Version: 1.2.1
 */

/* ── Variables ─────────────────────────────────── */
:root {
  --bp-pink: #e8a0d0;
  --bp-pink-border: #d476b8;
  --bp-blue: #3a82f7;
  --bp-blue-hover: #2563d8;
  --bp-text: #1a1a1a;
  --bp-label: #1a1a1a;
  --bp-placeholder: #aaa;
  --bp-input-bg: #f5f5f5;
  --bp-input-border: #e0e0e0;
  --bp-radius: 8px;
  --bp-radius-lg: 14px;
  --bp-transition: 0.25s ease;
  --bp-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
  --bp-overlay-bg: rgba(0, 0, 0, 0.55);
  --bp-panel-max-w: 480px;
  --bp-panel-min-h: 520px;
}

/* ── Honeypot (anti-spam) ────────────────────────── */
/*
 * This wrapper hides the honeypot input from human users.
 * Real users never see or fill it; bots that auto-fill all
 * inputs will populate it, triggering a silent 400 rejection.
 */
.barao-hp-field {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Trigger Button ──────────────────────────────── */
.barao-popup-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: var(--bp-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--bp-radius);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background var(--bp-transition), transform var(--bp-transition), box-shadow var(--bp-transition);
  box-shadow: 0 4px 14px rgba(58, 130, 247, 0.35);
}

.barao-popup-trigger:hover,
.barao-popup-trigger:focus-visible {
  background: var(--bp-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(58, 130, 247, 0.45);
  outline: none;
}

.barao-popup-trigger:active {
  transform: translateY(0);
}

/* ── Overlay / Backdrop ──────────────────────────── */
.barao-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bp-overlay-bg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--bp-transition), visibility var(--bp-transition);
  padding: 16px;
}

.barao-popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ── Modal Container ─────────────────────────────── */
.barao-popup-modal {
  display: flex;
  width: 100%;
  max-width: 860px;
  min-height: var(--bp-panel-min-h);
  border-radius: var(--bp-radius-lg);
  overflow: hidden;
  box-shadow: var(--bp-shadow);
  transform: translateY(18px) scale(0.97);
  transition: transform var(--bp-transition);
  background: #fff;
}

.barao-popup-overlay.is-open .barao-popup-modal {
  transform: translateY(0) scale(1);
}

/* ── Left Panel ──────────────────────────────────── */
.barao-popup-panel--left {
  flex: 0 0 45%;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
}

.barao-popup-panel--left::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.42) 100%);
}

.barao-popup-logo {
  position: relative;
  z-index: 2;
  max-width: 75%;
  max-height: 180px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.55));
}

/* ── Right Panel ─────────────────────────────────── */
.barao-popup-panel--right {
  flex: 1;
  padding: 38px 36px 38px 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border: 2.5px solid var(--bp-pink-border);
  background: #fff;
}

/* ── Close Button ────────────────────────────────── */
.barao-popup-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #e05c5c;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--bp-transition), color var(--bp-transition);
}

.barao-popup-close:hover,
.barao-popup-close:focus-visible {
  background: #fef0f0;
  color: #b91c1c;
  outline: none;
}

/* ── Form ────────────────────────────────────────── */
.barao-popup-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.barao-popup-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.barao-popup-label {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--bp-label);
}

.barao-popup-input,
.barao-popup-select {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--bp-input-border);
  border-radius: var(--bp-radius);
  background: var(--bp-input-bg);
  font-size: 0.95rem;
  color: var(--bp-text);
  transition: border-color var(--bp-transition), box-shadow var(--bp-transition);
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

.barao-popup-input::placeholder,
.barao-popup-select option[value=""] {
  color: var(--bp-placeholder);
}

.barao-popup-input:focus,
.barao-popup-select:focus {
  outline: none;
  border-color: var(--bp-pink-border);
  box-shadow: 0 0 0 3px rgba(212, 118, 184, 0.18);
}

/* Custom select arrow */
.barao-popup-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ── Submit Button ───────────────────────────────── */
.barao-popup-submit {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--bp-blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--bp-radius);
  cursor: pointer;
  letter-spacing: 0.3px;
  margin-top: 4px;
  transition: background var(--bp-transition), transform var(--bp-transition), box-shadow var(--bp-transition);
  box-shadow: 0 4px 14px rgba(58, 130, 247, 0.30);
}

.barao-popup-submit:hover:not(:disabled),
.barao-popup-submit:focus-visible:not(:disabled) {
  background: var(--bp-blue-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(58, 130, 247, 0.40);
  outline: none;
}

.barao-popup-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── Messages ────────────────────────────────────── */
.barao-popup-message {
  font-size: 0.9rem;
  min-height: 1.2em;
  border-radius: var(--bp-radius);
  padding: 0;
  transition: all var(--bp-transition);
}

.barao-popup-message.is-success {
  color: #166534;
  background: #dcfce7;
  padding: 10px 14px;
  border: 1px solid #86efac;
}

.barao-popup-message.is-error {
  color: #991b1b;
  background: #fee2e2;
  padding: 10px 14px;
  border: 1px solid #fca5a5;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 640px) {
  .barao-popup-modal {
    flex-direction: column;
    max-width: 100%;
    min-height: auto;
    border-radius: var(--bp-radius);
  }

  .barao-popup-panel--left {
    flex: none;
    height: 200px;
    min-height: 200px;
  }

  .barao-popup-panel--right {
    padding: 28px 20px 24px;
  }
}

/* ── Inline / standalone contact form ────────────── */
.barao-inline-form-wrap {
  width: 100%;
  max-width: 520px;
}

.barao-inline-form-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--bp-text);
  margin-bottom: 20px;
}

.barao-inline-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}