/* ==========================================================================
   FAZENDA SERRA DOS TAPES - DESIGN SYSTEM & CLEAN FORM
   ========================================================================== */

:root {
  --card-bg: #ffffff;
  --text-main: #000000;
  --text-sub: #1f2937;
  --text-muted: #6b7280;
  
  --border-input: #d1d5db;
  --border-input-focus: #000000;
  --input-bg: #ffffff;
  
  --color-error: #ef4444;
  --color-success: #10b981;
  
  --btn-bg: #000000;
  --btn-hover: #1f2937;
  --btn-text: #ffffff;
  
  --primary-gold: #c8a251;
  --primary-gold-hover: #deb862;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-input: 6px;
  --radius-card: 16px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-color: #142217;
}

/* ==========================================================================
   BACKGROUND WALLPAPER & OVERLAYS
   ========================================================================== */
.bg-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-image {
  position: absolute;
  inset: -10px;
  background-size: cover;
  background-position: center 30%;
  filter: brightness(0.92) contrast(1.05);
  transform: scale(1.02);
  transition: transform 0.8s ease-out;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(20, 34, 23, 0.4) 0%, rgba(15, 26, 17, 0.75) 100%),
              linear-gradient(180deg, rgba(15, 26, 17, 0.45) 0%, rgba(15, 26, 17, 0.6) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ==========================================================================
   PAGE STRUCTURE
   ========================================================================== */
.page-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px;
  gap: 16px;
}

/* Brand Header & Transparent Logo */
.brand-header {
  text-align: center;
  margin-bottom: 2px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-logo-link:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.brand-logo-img {
  display: block;
  max-width: 270px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.75)) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

/* ==========================================================================
   FORM CARD
   ========================================================================== */
.form-card {
  width: 100%;
  max-width: 500px;
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 44px 36px 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-title {
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.card-subtitle {
  font-size: 1rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  font-weight: 400;
}

/* Form Groups & Inputs */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-main);
  background-color: var(--input-bg);
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 1px var(--border-input-focus);
}

.form-input.has-error {
  border-color: var(--color-error);
}

.field-error {
  font-size: 0.78rem;
  color: var(--color-error);
  margin-top: 4px;
  display: none;
}

.field-error.visible {
  display: block;
}

/* ==========================================================================
   PHONE INPUT WITH COUNTRY SELECTOR & FLAGS
   ========================================================================== */
.phone-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-input);
  background-color: var(--input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.phone-input-wrapper:focus-within {
  border-color: var(--border-input-focus);
  box-shadow: 0 0 0 1px var(--border-input-focus);
}

.phone-input-wrapper.has-error {
  border-color: var(--color-error);
}

.country-dropdown-container {
  position: relative;
  display: flex;
  align-items: center;
}

.country-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 10px 0 12px;
  background: #f9fafb;
  border: none;
  border-right: 1px solid var(--border-input);
  border-radius: var(--radius-input) 0 0 var(--radius-input);
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
  transition: background-color 0.15s ease;
}

.country-trigger-btn:hover {
  background-color: #f3f4f6;
}

.country-flag-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.country-code-text {
  font-weight: 600;
  font-size: 0.88rem;
  color: #374151;
}

.chevron-icon {
  color: #9ca3af;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.country-dropdown-container.open .chevron-icon {
  transform: rotate(180deg);
}

.phone-input-wrapper .phone-input {
  border: none;
  height: 44px;
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  padding: 0 14px;
  flex: 1;
}

.phone-input-wrapper .phone-input:focus {
  box-shadow: none;
}

/* Country Dropdown Menu */
.country-menu-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  max-height: 280px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 100;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.15s ease-out;
}

.country-menu-search {
  padding: 8px;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
}

.country-search-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  outline: none;
}

.country-search-input:focus {
  border-color: #000000;
}

.country-options-scroll {
  overflow-y: auto;
  max-height: 220px;
}

.country-option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: 0.86rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.country-option-item:hover,
.country-option-item.selected {
  background-color: #f3f4f6;
}

.country-option-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.country-option-dial {
  font-weight: 600;
  color: #6b7280;
  font-size: 0.82rem;
}

/* ==========================================================================
   SINGLE CHECKBOX
   ========================================================================== */
.consent-group {
  margin: 16px 0 24px;
  display: flex;
  flex-direction: column;
}

.clean-checkbox-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.clean-checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-check-box {
  width: 19px;
  height: 19px;
  border-radius: 4px;
  border: 1.5px solid #9ca3af;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.15s ease;
}

.custom-check-box svg {
  opacity: 0;
  stroke: #ffffff;
  transform: scale(0.6);
  transition: all 0.15s ease;
}

.clean-checkbox-item input[type="checkbox"]:checked + .custom-check-box {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
}

.clean-checkbox-item input[type="checkbox"]:checked + .custom-check-box svg {
  opacity: 1;
  transform: scale(1);
}

.consent-desc {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* ==========================================================================
   BUTTON
   ========================================================================== */
.btn-submit {
  width: 100%;
  height: 48px;
  background-color: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--radius-input);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-submit:hover {
  background-color: var(--btn-hover);
}

.btn-submit:active {
  transform: scale(0.99);
}

.btn-submit.loading .btn-label {
  display: none;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-submit.loading .btn-spinner {
  display: block;
}

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

/* ==========================================================================
   SUCCESS VIEW
   ========================================================================== */
.success-view {
  text-align: center;
  padding: 10px 0;
  animation: fadeIn 0.3s ease-out;
}

.success-icon-badge {
  width: 56px;
  height: 56px;
  background: #111827;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.success-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.success-text {
  font-size: 0.95rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  line-height: 1.5;
}

.success-details-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.details-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 6px;
}

.details-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.details-label {
  font-weight: 600;
  color: #4b5563;
}

.details-value {
  color: #111827;
  font-weight: 500;
}

/* Success Store CTA */
.success-store-cta {
  margin-bottom: 16px;
}

.btn-visit-store {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #c8a251 0%, #deb862 100%);
  color: #142217;
  border-radius: var(--radius-input);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(200, 162, 81, 0.3);
  transition: all 0.2s ease;
}

.btn-visit-store:hover {
  background: linear-gradient(135deg, #deb862 0%, #ecd08c 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(200, 162, 81, 0.45);
}

.btn-reset {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-input);
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-reset:hover {
  background: #f3f4f6;
  color: #111827;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 540px) {
  .page-container {
    padding: 32px 16px;
  }

  .brand-logo-img {
    max-width: 220px;
  }

  .form-card {
    padding: 32px 22px;
  }

  .card-title {
    font-size: 1.85rem;
  }
}
