/**
 * PRIME CORRETORA - Reusable UI Components
 */

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn:hover svg {
  transform: translateX(3px);
}

/* Primary CTA Button (Laranja #FF5C00) */
.btn-primary {
  background-color: var(--color-cta);
  color: var(--color-white);
  box-shadow: var(--shadow-cta);
}

.btn-primary:hover {
  background-color: var(--color-cta-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(255, 92, 0, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button (Petrol #12334A) */
.btn-secondary {
  background-color: var(--color-petrol);
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background-color: var(--color-petrol-light);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* WhatsApp CTA Button */
.btn-whatsapp {
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  box-shadow: var(--shadow-whatsapp);
}

.btn-whatsapp:hover {
  background-color: var(--color-whatsapp-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(37, 211, 102, 0.48);
}

.btn-whatsapp svg {
  fill: currentColor;
}

.btn-whatsapp:hover svg {
  transform: scale(1.12);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  color: var(--color-petrol);
  border-color: var(--color-border);
}

.btn-outline:hover {
  background-color: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

/* Outline Light (for dark backgrounds) */
.btn-outline-light {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}

.btn-outline-light:hover {
  background-color: var(--color-white);
  color: var(--color-petrol);
  border-color: var(--color-white);
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-lg {
  padding: 17px 34px;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  display: flex;
  width: 100%;
}

/* ==========================================================================
   Trust Indicators & Badges
   ========================================================================== */

.trust-badge-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.trust-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-petrol);
  background-color: var(--color-white);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-sm);
}

.trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-primary);
}

/* ==========================================================================
   Floating WhatsApp Button
   ========================================================================== */

.whatsapp-float-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.whatsapp-callout {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--color-white);
  color: var(--color-petrol);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--color-border);
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 260px;
  transform-origin: bottom right;
  animation: fadeInUp 0.4s ease 1s backwards;
  position: relative;
}

.whatsapp-callout::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 26px;
  width: 12px;
  height: 12px;
  background-color: var(--color-white);
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  transform: rotate(45deg);
}

.whatsapp-callout-close {
  background: none;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: 2px;
  font-size: 1rem;
  line-height: 1;
}

.whatsapp-callout-close:hover {
  color: var(--color-petrol);
}

.whatsapp-float-btn {
  width: 62px;
  height: 62px;
  border-radius: var(--radius-full);
  background-color: var(--color-whatsapp);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-whatsapp);
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  cursor: pointer;
}

.whatsapp-float-btn:hover {
  background-color: var(--color-whatsapp-hover);
  transform: scale(1.08);
  box-shadow: 0 16px 36px rgba(37, 211, 102, 0.55);
}

.whatsapp-float-btn svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.whatsapp-online-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: #25D366;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.4);
  animation: pulseSubtle 2.5s infinite;
}

/* ==========================================================================
   Mobile Sticky Bottom Contact Bar
   ========================================================================== */

.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 998;
  box-shadow: 0 -4px 20px rgba(18, 51, 74, 0.1);
}

.mobile-sticky-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-sticky-bar .btn {
  padding: 12px 14px;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Cookie Consent Banner (LGPD)
   ========================================================================== */

.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 24px 28px;
  z-index: 10001;
  display: none;
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cookie-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cookie-header h4 {
  font-size: 1.1rem;
  color: var(--color-petrol);
}

.cookie-body p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin-bottom: 0;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.cookie-actions .btn {
  font-size: 0.88rem;
  padding: 10px 20px;
}

/* Cookie Preferences Modal */
.cookie-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 51, 74, 0.65);
  backdrop-filter: blur(4px);
  z-index: 10002;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cookie-modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  max-width: 620px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: var(--shadow-xl);
  position: relative;
}

.cookie-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.cookie-modal-header h3 {
  color: var(--color-petrol);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-subtle);
  line-height: 1;
}

.cookie-category {
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.cookie-category-title {
  font-weight: 700;
  color: var(--color-petrol);
  font-size: 1rem;
}

.cookie-category-desc {
  font-size: 0.86rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Switch toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

input:disabled + .slider {
  background-color: var(--color-primary);
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   Form Input Elements
   ========================================================================== */

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-petrol);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--color-text-main);
  background-color: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-subtle);
  outline: none;
}

.form-control.is-invalid {
  border-color: #DC2626;
  background-color: #FEF2F2;
}

.form-error-feedback {
  display: none;
  color: #DC2626;
  font-size: 0.82rem;
  margin-top: 6px;
  font-weight: 600;
}

.form-control.is-invalid + .form-error-feedback {
  display: block;
}

/* Honeypot field (hidden from genuine users) */
.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Consent Checkbox */
.form-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.86rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  cursor: pointer;
}

.form-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--color-cta);
  flex-shrink: 0;
  cursor: pointer;
}
