/* ==========================================================================
   COMPONENTS - Buttons, Cards, Inputs (No Duplicates)
   ========================================================================== */

/* =========================
   CSS VARIABLES (if not in main styles.css)
   ========================= */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  
  --primary: #16a34a;
  --primary-hover: #15803d;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-800: #166534;
  
  --text-primary: var(--text, #0f172a);
  --text-secondary: var(--muted, #64748b);
  
  --bg-primary: var(--bg, #ffffff);
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --border-light: rgba(15, 23, 42, 0.08);
  --border-medium: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.18);
  
  --glass-white-strong: rgba(255, 255, 255, 0.85);
  --glass-blur: 14px;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 14px 28px rgba(22, 163, 74, 0.22);
  --shadow-primary-lg: 0 22px 44px rgba(22, 163, 74, 0.28);
  
  --transition-base: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* =========================
   BUTTONS
   ========================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2, 8px);
  
  padding: 12px 20px;
  min-height: 44px;
  
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
  
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  
  transition: all 0.2s ease;
  will-change: transform;
  transform: translateZ(0);
}

.btn-sm {
  padding: 8px 16px;
  min-height: 36px;
  font-size: 14px;
}

.btn-lg {
  padding: 14px 24px;
  min-height: 52px;
  font-size: 16px;
  border-radius: 16px;
}

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

.btn-sm .btn-icon {
  width: 16px;
  height: 16px;
}

.btn-lg .btn-icon {
  width: 22px;
  height: 22px;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(180deg, var(--green2, #1b8a58), var(--green, #055f38));
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 107, 67, 0.22), 0 2px 0 rgba(255, 255, 255, 0.18) inset;
  overflow: hidden;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.15) 50%, 
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 22px 44px rgba(15, 107, 67, 0.28), 0 2px 0 rgba(255, 255, 255, 0.18) inset;
}

.btn-primary:hover::before {
  transform: translateX(100%) rotate(45deg);
}

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

/* Ghost/Secondary Button */
.btn-ghost,
.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  color: var(--text-primary, #0f172a);
  border: 1px solid rgba(15, 23, 42, 0.14);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.06);
}

.btn-ghost:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.12);
  border-color: rgba(15, 23, 42, 0.20);
}

.btn-ghost:active,
.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  color: var(--primary, #16a34a);
  border: 2px solid var(--primary, #16a34a);
}

.btn-outline:hover {
  background: var(--primary, #16a34a);
  color: white;
  box-shadow: var(--shadow-primary, 0 14px 28px rgba(22, 163, 74, 0.22));
  transform: translateY(-2px);
}

.btn-outline:active {
  transform: translateY(0) scale(0.98);
}

/* Link Button */
.btn-link {
  background: transparent;
  color: var(--primary, #16a34a);
  border: none;
  padding: 8px 12px;
  min-height: auto;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-link:hover {
  color: var(--primary-hover, #15803d);
  text-decoration-thickness: 2px;
}

/* Disabled state */
.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

/* Loading state */
.btn[data-loading="true"] {
  position: relative;
  color: transparent;
  pointer-events: none;
}

.btn[data-loading="true"]::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin-left: -8px;
  margin-top: -8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  animation: btn-spin 0.6s linear infinite;
}

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

/* =========================
   CARDS
   ========================= */
.card {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--border-light, rgba(15, 23, 42, 0.10));
  border-radius: var(--radius, 22px);
  box-shadow: var(--shadow2, 0 10px 28px rgba(15, 23, 42, 0.10));
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl, 0 20px 25px rgba(0, 0, 0, 0.1));
  border-color: var(--border-medium, rgba(15, 23, 42, 0.12));
}

.card-pad,
.card-body {
  padding: 22px;
}

.card-header {
  padding: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light, rgba(15, 23, 42, 0.08));
}

.card-footer {
  padding: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light, rgba(15, 23, 42, 0.08));
}

.card-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}

.card-description {
  margin: 0;
  color: var(--text-secondary, #64748b);
  line-height: 1.6;
}

/* =========================
   TYPOGRAPHY
   ========================= */
h2 {
  margin: 0 0 14px;
  font-size: 30px;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h3 {
  margin: 0 0 6px;
  font-weight: 700;
}

/* =========================
   LAYOUT
   ========================= */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* =========================
   STEPS (How it works)
   ========================= */
.steps {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.step:last-child {
  border-bottom: none;
}

.step-title {
  font-weight: 900;
}

/* =========================
   WHY SECTION
   ========================= */
.why-grid {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.why {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 16px;
  background: rgba(27, 138, 88, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.why:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.10);
}

.why-ico {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(27, 138, 88, 0.14);
  display: grid;
  place-items: center;
  color: var(--green, #055f38);
  font-weight: 900;
  flex: 0 0 auto;
}

/* =========================
   BADGES
   ========================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.badge-primary {
  background: var(--green-100, #dcfce7);
  color: var(--green-800, #166534);
  border: 1px solid var(--green-200, #bbf7d0);
}

.badge-secondary {
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--text-primary, #0f172a);
  border: 1px solid var(--border-medium, rgba(15, 23, 42, 0.12));
}

/* =========================
   INPUTS
   ========================= */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px; /* fix #2: was 15px — iOS Safari zooms at < 16px */
  line-height: 1.5;
  color: var(--text-primary, #0f172a);
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-medium, rgba(15, 23, 42, 0.12));
  border-radius: 14px;
  transition: all 0.2s ease;
  appearance: none;
}

.input:hover,
input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong, rgba(15, 23, 42, 0.18));
}

.input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary, #16a34a);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.input:disabled,
input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-secondary, #f8fafc);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group .input,
.input-group input {
  flex: 1;
}

/* =========================
   LOADING/SKELETON STATES
   ========================= */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary, #f8fafc) 0%,
    var(--bg-tertiary, #f1f5f9) 50%,
    var(--bg-secondary, #f8fafc) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 12px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 2em;
  width: 60%;
  margin-bottom: 16px;
}

/* =========================
   ANIMATIONS
   ========================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

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

.slide-up {
  animation: slideUp 0.4s ease-out;
}

/* =========================
   RESPONSIVE UTILITIES
   ========================= */
@media (max-width: 640px) {
  .hide-mobile {
    display: none;
  }
}

@media (min-width: 641px) {
  .show-mobile {
    display: none;
  }
}
/* =========================
   FIX #8: FAQ scroll margin + tap feel
   ========================= */
.faq-list details {
  scroll-margin-top: 84px;
}
.faq-list summary {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  list-style: none;
  padding-right: 28px;
  position: relative;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list details[open] > summary {
  color: var(--green, #16a34a);
}
