/* ============================================
   REALTORS TOOLKIT - Design System
   Clean, Professional, iLovePDF-inspired
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --primary: #1a56db;
  --primary-dark: #1341b0;
  --primary-light: #e8f0fe;
  --accent: #e8450a;
  --accent-light: #fff0eb;
  --success: #0e9f6e;
  --warning: #f59e0b;
  --text-primary: #111928;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-focus: #1a56db;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 30px rgba(26,86,219,0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── LAYOUT ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.logo-text span { color: var(--primary); }

.nav { display: flex; align-items: center; gap: 4px; }

.nav a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.nav a:hover { background: var(--bg-soft); color: var(--text-primary); }

.btn-nav {
  background: var(--primary) !important;
  color: white !important;
  padding: 8px 18px !important;
}

.btn-nav:hover { background: var(--primary-dark) !important; }

.hamburger { display: none; cursor: pointer; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #fef9f6 50%, #f0fff8 100%);
  padding: 72px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(26,86,219,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(232,69,10,0.05) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: 0.2px;
}

.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--text-primary);
  max-width: 700px;
  margin: 0 auto 20px;
}

.hero h1 em {
  font-style: italic;
  color: var(--primary);
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat span {
  font-size: 13px;
  color: var(--text-muted);
}

.hero-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

/* ── CATEGORY FILTER ── */
.category-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 64px;
  z-index: 90;
}

.category-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 12px 0;
  scrollbar-width: none;
}

.category-inner::-webkit-scrollbar { display: none; }

.cat-btn {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}

.cat-btn:hover { border-color: var(--primary); color: var(--primary); }

.cat-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ── TOOLS GRID ── */
.tools-section { padding: 48px 0 80px; }

.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-top: 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-color, var(--primary));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tool-card:hover {
  border-color: var(--card-color, var(--primary));
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.tool-card:hover::before { opacity: 1; }

.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 14px;
  background: var(--card-bg, var(--primary-light));
  flex-shrink: 0;
}

.tool-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.tool-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tool-badge.free {
  background: var(--success);
}

/* ── SECTION DIVIDERS ── */
.tools-section-group { margin-bottom: 48px; }

/* ── TOOL PAGE ── */
.tool-page { min-height: calc(100vh - 64px); }

.tool-hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, white 100%);
  padding: 48px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.tool-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(26,86,219,0.25);
}

.tool-hero h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.tool-hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto;
}

.tool-workspace {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-soft);
  position: relative;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.dropzone h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.dropzone p {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 16px rgba(26,86,219,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-soft);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-accent:hover {
  background: #c73a07;
  box-shadow: 0 4px 16px rgba(232,69,10,0.3);
  transform: translateY(-1px);
}

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ── FORM CONTROLS ── */
.form-group { margin-bottom: 20px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  color: var(--text-primary);
  background: white;
  transition: var(--transition);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── CARD ── */
.card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

/* ── RESULT BOX ── */
.result-box {
  background: var(--primary-light);
  border: 1.5px solid rgba(26,86,219,0.2);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 28px;
  animation: fadeUp 0.3s ease;
}

.result-box h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 16px;
}

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

/* ── RESULT VALUE ── */
.result-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'DM Serif Display', serif;
  letter-spacing: -1px;
  margin-bottom: 4px;
}

.result-label {
  font-size: 13px;
  color: var(--text-muted);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.result-item {
  background: white;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid rgba(26,86,219,0.1);
}

.result-item .val {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'DM Serif Display', serif;
}

.result-item .lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── PROGRESS ── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 16px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #5b8ef7);
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ── FILE LIST ── */
.file-list {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.file-item-icon { font-size: 20px; }
.file-item-name { flex: 1; font-weight: 500; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-size { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.file-item-remove { color: var(--text-muted); cursor: pointer; transition: var(--transition); font-size: 18px; flex-shrink: 0; line-height: 1; }
.file-item-remove:hover { color: var(--accent); }

/* ── TOAST ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--text-primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}

.toast.success { background: var(--success); }
.toast.error { background: #ef4444; }
.toast.info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 12px 0;
}

.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

/* ── FOOTER ── */
.footer {
  background: var(--text-primary);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand .logo { filter: brightness(0) invert(1); margin-bottom: 12px; }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 260px; }

.footer h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  margin-bottom: 16px;
}

.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul li a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.footer ul li a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.footer-disclaimer {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: 8px;
  max-width: 600px;
}

/* ── LOADING SPINNER ── */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── RANGE SLIDER ── */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 100px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(26,86,219,0.3);
  transition: var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* ── TABS ── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── CHECKBOX / TOGGLE ── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.toggle-row:last-child { border-bottom: none; }

.toggle-label { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .nav { display: none; }
  .hamburger { display: block; }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 28px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero-stats { gap: 20px; }
  .hero-divider { display: none; }
  .result-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 14px; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── UTILITY ── */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }
