/* ============================================================
   JOHN DEERE FLORESTAL – FORMULÁRIO DE GARANTIA
   style.css – Versão 2.0
   ============================================================ */

/* --- VARIÁVEIS --- */
:root {
  --green-dark:   #1e4d14;
  --green-main:   #367c2b;
  --green-light:  #4a9e38;
  --yellow-jd:    #ffde00;
  --yellow-hover: #f5d000;
  --gray-100:     #f8f9fa;
  --gray-200:     #e9ecef;
  --gray-300:     #dee2e6;
  --gray-500:     #adb5bd;
  --gray-700:     #495057;
  --gray-900:     #212529;
  --white:        #ffffff;
  --red-error:    #c62828;
  --red-bg:       #ffebee;
  --green-success:#2e7d32;
  --green-bg:     #e8f5e9;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;

  --transition:   all 0.25s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =============================================================
   HEADER
   ============================================================= */
.main-header {
  background: var(--white);
  border-bottom: 3px solid var(--yellow-jd);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.logo a { display: flex; align-items: center; }
.logo img { width: 170px; height: auto; }

/* Nav */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.main-nav a:hover {
  color: var(--green-main);
  background: rgba(54,124,43,.07);
}

/* Submenu */
.has-submenu { position: relative; }

.submenu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--white);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  border-radius: var(--radius-md);
  padding: 8px 0;
  border-top: 3px solid var(--green-main);
  z-index: 200;
  pointer-events: none;
}

.has-submenu:hover > .submenu {
  display: block;
  pointer-events: auto;
}

.submenu li { display: block; }
.submenu li a {
  display: block;
  padding: 10px 18px;
  font-size: 13px;
  border-radius: 0;
  color: var(--gray-700);
}
.submenu li a:hover { color: var(--green-main); background: var(--gray-100); }

/* Hamburger Button */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-menu-btn.active .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mobile-menu-btn.active .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-btn.active .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================================
   HERO BANNER
   ============================================================= */
.hero-banner {
  position: relative;
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-main) 60%, var(--green-light) 100%);
  padding: 60px 0 50px;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 80% 50%, rgba(255,222,0,.08) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,222,0,.18);
  color: var(--yellow-jd);
  border: 1px solid rgba(255,222,0,.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 14px;
  text-align: left;
}

.hero-accent {
  color: var(--yellow-jd);
}

.hero-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,.82);
  max-width: 560px;
  font-weight: 400;
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.main-content {
  flex: 1;
  padding: 40px 0 60px;
}

.form-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =============================================================
   CARDS
   ============================================================= */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 2px solid var(--gray-200);
  background: linear-gradient(135deg, #f8fdf7 0%, #fff 100%);
}

.card-icon {
  width: 44px;
  height: 44px;
  background: var(--green-main);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--white);
}

.card-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.card-header p {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 400;
}

.card-body {
  padding: 24px;
}

/* =============================================================
   FORM ELEMENTS
   ============================================================= */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.required-star { color: var(--red-error); }

/* Inputs */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(54,124,43,.15);
}

input::placeholder, textarea::placeholder { color: var(--gray-500); font-weight: 400; }

textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* Select */
.select-wrapper {
  position: relative;
}

.select-wrapper select {
  width: 100%;
  padding: 12px 40px 12px 14px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-900);
  background: var(--white);
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: var(--transition);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--green-main);
  box-shadow: 0 0 0 3px rgba(54,124,43,.15);
}

.select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500);
  pointer-events: none;
  font-size: 12px;
}

/* --- RADIO BUTTONS CUSTOM --- */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-700);
  padding: 10px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  user-select: none;
  flex: 1;
  min-width: 140px;
}

.radio-label:has(input:checked) {
  border-color: var(--green-main);
  background: rgba(54,124,43,.06);
  color: var(--green-main);
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}

.radio-label:has(input:checked) .radio-custom {
  border-color: var(--green-main);
  background: var(--green-main);
  box-shadow: inset 0 0 0 4px var(--white);
}

/* --- CHECKBOX CUSTOM --- */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--gray-700);
  padding: 12px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  user-select: none;
}

.checkbox-label:has(input:checked) {
  border-color: var(--green-main);
  background: rgba(54,124,43,.06);
  color: var(--green-dark);
}

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

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  font-size: 13px;
  color: transparent;
}

.checkbox-label:has(input:checked) .checkbox-custom {
  background: var(--green-main);
  border-color: var(--green-main);
  color: var(--white);
}

.checkbox-label:has(input:checked) .checkbox-custom::after {
  content: '✓';
  font-weight: 700;
  font-size: 12px;
  color: var(--white);
}

/* --- DROP ZONE --- */
.drop-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--gray-100);
  transition: var(--transition);
  position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--green-main);
  background: rgba(54,124,43,.04);
}

.drop-zone.has-file {
  border-color: var(--green-main);
  border-style: solid;
  background: rgba(54,124,43,.05);
}

.drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.drop-zone-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.drop-zone:hover .drop-zone-icon,
.drop-zone.drag-over .drop-zone-icon {
  background: rgba(54,124,43,.15);
}

.drop-zone.has-file .drop-zone-icon {
  background: rgba(54,124,43,.2);
}

.drop-zone-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--gray-500);
  transition: var(--transition);
}

.drop-zone:hover .drop-zone-icon svg,
.drop-zone.drag-over .drop-zone-icon svg,
.drop-zone.has-file .drop-zone-icon svg {
  stroke: var(--green-main);
}

.drop-zone-prompt {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 4px;
  word-break: break-all;
}

.drop-zone.has-file .drop-zone-prompt {
  color: var(--green-main);
}

.drop-zone-hint {
  font-size: 12px;
  color: var(--gray-500);
}

/* --- FIELD ERRORS --- */
.field-error {
  display: block;
  font-size: 12px;
  color: var(--red-error);
  margin-top: 5px;
  font-weight: 500;
}

/* --- SUBMIT --- */
.submit-card .card-body {
  padding: 28px 24px;
}

#form-status {
  margin-bottom: 16px;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: none;
}

#form-status:not(:empty) { display: block; }

#form-status.error   { background: var(--red-bg);   color: var(--red-error); }
#form-status.success { background: var(--green-bg);  color: var(--green-success); }

#submit-btn {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--green-main) 0%, var(--green-dark) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  letter-spacing: .02em;
}

#submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--green-main) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(54,124,43,.35);
}

#submit-btn:active:not(:disabled) { transform: translateY(0); }

#submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  flex-shrink: 0;
}

.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

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

.submit-disclaimer {
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 12px;
}

/* =============================================================
   FOOTER
   ============================================================= */
.main-footer {
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 48px 0 20px;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand p {
  font-size: 13px;
  color: var(--gray-700);
  margin-top: 16px;
  line-height: 1.7;
}

.footer-col h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  text-decoration: none;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--green-main); }

.social-icons { display: flex; gap: 10px; flex-wrap: wrap; }

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.social-icon:hover {
  background: var(--green-main);
  transform: translateY(-2px);
}

.social-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--gray-700);
  transition: var(--transition);
}

.social-icon:hover svg { fill: var(--white); }

.footer-bottom {
  border-top: 1px solid var(--gray-200);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}

/* =============================================================
   RESPONSIVE – TABLET
   ============================================================= */
@media (max-width: 1024px) {
  .main-nav a { font-size: 12px; padding: 5px 8px; }
}

@media (max-width: 900px) {
  .footer-content { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* =============================================================
   RESPONSIVE – MOBILE
   ============================================================= */
@media (max-width: 768px) {

  /* Header */
  .mobile-menu-btn { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    padding: 12px 0;
    max-height: 75vh;
    overflow-y: auto;
  }

  .main-nav.active { display: block; }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 16px;
  }

  .main-nav li { width: 100%; }

  .main-nav a {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  /* No mobile o submenu fica sempre visível dentro do menu aberto */
  .has-submenu .submenu {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    border-left: 3px solid var(--green-main);
    border-radius: 0;
    background: var(--gray-100);
    padding: 4px 0 4px 16px;
    margin: 4px 0;
  }

  /* Garante que o :hover do desktop não interfere no mobile */
  .has-submenu:hover .submenu {
    display: block;
  }

  .submenu li a { font-size: 14px; padding: 8px 12px; }

  .main-header { position: relative; }

  /* Hero */
  .hero-banner { padding: 36px 0 30px; }
  .hero-title { font-size: 1.6rem; }
  .hero-subtitle { font-size: 14px; }

  /* Form */
  .form-row { grid-template-columns: 1fr; gap: 0; }

  .card-header { padding: 16px 18px; gap: 12px; }
  .card-icon { width: 38px; height: 38px; }
  .card-icon svg { width: 18px; height: 18px; }
  .card-header h2 { font-size: 1rem; }
  .card-body { padding: 18px; }

  .radio-group { flex-direction: column; gap: 8px; }
  .radio-label { min-width: auto; }

  /* Footer */
  .footer-content { grid-template-columns: 1fr; gap: 28px; }
  .footer-brand { grid-column: auto; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.4rem; }
  .container { padding: 0 14px; }
  .card-body { padding: 14px; }
  #submit-btn { font-size: 15px; padding: 14px; }
}
