/* ===== CARDINAL LEASE CALCULATOR — WordPress Plugin Styles ===== */
/* Version: 1.0.0 */

/* Note: Uses system fonts to match your WordPress theme. */
/* To use custom fonts, uncomment the @import below and update --cl-font. */
/* @import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&display=swap'); */

:root {
  --cl-red: #C8102E;
  --cl-red-dark: #A00D24;
  --cl-red-light: #FFF1F3;
  --cl-charcoal: #1E1E1E;
  --cl-gray-900: #2D2D2D;
  --cl-gray-700: #4A4A4A;
  --cl-gray-500: #6B6B6B;
  --cl-gray-300: #B0B0B0;
  --cl-gray-100: #F4F4F5;
  --cl-white: #FFFFFF;
  --cl-green: #0F7B3F;
  --cl-green-light: #EDFAF2;
  --cl-radius: 10px;
  --cl-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.06);
  --cl-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Widget Container ===== */
.cl-lease-widget {
  font-family: var(--cl-font);
  max-width: 100%;
  margin: 24px 0;
  color: var(--cl-charcoal);
  -webkit-font-smoothing: antialiased;
}

.cl-lease-widget *,
.cl-lease-widget *::before,
.cl-lease-widget *::after {
  box-sizing: border-box;
}

/* ===== Card ===== */
.cl-card {
  background: var(--cl-white);
  border-radius: var(--cl-radius);
  box-shadow: var(--cl-shadow);
  overflow: hidden;
  margin-bottom: 16px;
}

.cl-card-header {
  background: var(--cl-charcoal);
  color: var(--cl-white);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl-card-header svg { flex-shrink: 0; }
.cl-card-header h3 {
  font-family: var(--cl-font);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--cl-white);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.cl-card-body {
  padding: 24px;
}

/* ===== Equipment Type Toggle ===== */
.cl-type-toggle {
  display: flex;
  background: var(--cl-gray-100);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.cl-type-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--cl-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent !important;
  color: var(--cl-gray-700) !important;
  position: relative;
  z-index: 1;
  pointer-events: auto;
  box-shadow: none;
}
.cl-type-btn.active {
  background: var(--cl-white) !important;
  color: var(--cl-charcoal) !important;
  border-color: var(--cl-gray-300);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.cl-type-btn:not(.active) {
  background: transparent !important;
  color: var(--cl-gray-500) !important;
}
.cl-type-btn:focus-visible {
  outline: 2px solid var(--cl-red);
  outline-offset: 2px;
}

/* ===== Payment Grid ===== */
.cl-payments-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.cl-payment-option {
  border: 2px solid var(--cl-gray-100);
  border-radius: 10px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  background: var(--cl-white);
}
.cl-payment-option:hover {
  border-color: var(--cl-gray-300);
}
.cl-payment-option.selected {
  border-color: var(--cl-red);
  background: var(--cl-red-light);
}
.cl-payment-option .cl-term {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cl-gray-500);
  margin-bottom: 6px;
}
.cl-payment-option.selected .cl-term {
  color: var(--cl-red-dark);
}
.cl-payment-option .cl-amount {
  font-family: var(--cl-font);
  font-size: 24px;
  font-weight: 700;
  color: var(--cl-charcoal);
  line-height: 1.1;
}
.cl-payment-option.selected .cl-amount {
  color: var(--cl-red);
}
.cl-payment-option .cl-per-mo {
  font-size: 12px;
  color: var(--cl-gray-500);
  margin-top: 2px;
}
.cl-payment-option .cl-best-value {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cl-green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ===== Summary Box ===== */
.cl-summary {
  background: var(--cl-gray-100);
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 6px;
}
.cl-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 14px;
}
.cl-summary-row .cl-label { color: var(--cl-gray-500); }
.cl-summary-row .cl-value { font-weight: 600; }
.cl-summary-row.cl-highlight {
  border-top: 1px solid var(--cl-gray-300);
  margin-top: 6px;
  padding-top: 12px;
}
.cl-summary-row.cl-highlight .cl-label {
  color: var(--cl-charcoal);
  font-weight: 600;
}
.cl-summary-row.cl-highlight .cl-value {
  color: var(--cl-red);
  font-size: 18px;
  font-weight: 700;
}

/* ===== Disclaimer ===== */
.cl-disclaimer {
  font-size: 12px;
  color: var(--cl-gray-500);
  line-height: 1.5;
  padding: 12px 0 0;
}

/* ===== CTA Button ===== */
.cl-cta-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--cl-red);
  color: var(--cl-white);
  font-family: var(--cl-font);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--cl-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
  text-align: center;
}
.cl-cta-btn:hover {
  background: var(--cl-red-dark);
  box-shadow: 0 4px 16px rgba(200, 16, 46, 0.35);
  transform: translateY(-1px);
}

/* ===== Phone Link ===== */
.cl-phone-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--cl-gray-500);
}
.cl-phone-link a {
  color: var(--cl-red);
  text-decoration: none;
  font-weight: 600;
}

/* ===== Form Overlay / Modal ===== */
.cl-form-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  justify-content: center;
  align-items: flex-end;
  backdrop-filter: blur(3px);
}
.cl-form-overlay.open {
  display: flex;
}

.cl-form-sheet {
  background: var(--cl-white);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  border-radius: 16px 16px 0 0;
  overflow-y: auto;
  animation: cl-slide-up 0.3s ease;
  position: relative;
}

@media (min-width: 600px) {
  .cl-form-overlay { align-items: center; }
  .cl-form-sheet {
    border-radius: var(--cl-radius);
    max-height: 85vh;
    margin: 20px;
  }
}

@keyframes cl-slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Form header */
.cl-form-header {
  background: var(--cl-charcoal);
  color: var(--cl-white);
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
}
.cl-form-header h3 {
  font-family: var(--cl-font);
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--cl-white) !important;
}
.cl-form-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.cl-form-close:hover {
  background: rgba(255,255,255,0.25);
}

/* Form body */
.cl-form-body { padding: 24px; }

/* Equipment summary in form */
.cl-form-equip-summary {
  background: var(--cl-gray-100);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.cl-form-equip-summary .cl-equip-detail { color: var(--cl-gray-700); }
.cl-form-equip-summary .cl-equip-payment {
  font-weight: 700;
  color: var(--cl-red);
  font-size: 16px;
}

/* Form fields */
.cl-field { margin-bottom: 16px; }
.cl-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--cl-gray-700);
  margin-bottom: 5px;
}
.cl-field input,
.cl-field select,
.cl-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--cl-gray-300);
  border-radius: 8px;
  font-family: var(--cl-font);
  font-size: 15px;
  color: var(--cl-charcoal);
  transition: border-color 0.15s;
  background: var(--cl-white);
  -webkit-appearance: none;
}
.cl-field input:focus,
.cl-field select:focus,
.cl-field textarea:focus {
  outline: none;
  border-color: var(--cl-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.08);
}
.cl-field textarea {
  resize: vertical;
  min-height: 80px;
}
.cl-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Submit button */
.cl-submit-btn {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--cl-red);
  color: var(--cl-white);
  font-family: var(--cl-font);
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--cl-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.3);
  margin-top: 8px;
}
.cl-submit-btn:hover { background: var(--cl-red-dark); }
.cl-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Success state */
.cl-success {
  text-align: center;
  padding: 40px 24px;
}
.cl-success-icon {
  width: 56px;
  height: 56px;
  background: var(--cl-green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.cl-success h4 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
}
.cl-success p {
  font-size: 14px;
  color: var(--cl-gray-500);
  margin: 0 0 24px;
  line-height: 1.5;
}
.cl-success p a {
  color: var(--cl-red);
  font-weight: 600;
  text-decoration: none;
}
.cl-success-btn {
  background: var(--cl-gray-100);
  border: none;
  padding: 12px 32px;
  border-radius: 8px;
  font-family: var(--cl-font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--cl-gray-700);
}
