/* ============================================
   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: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}
.logo-text { font-size: 16px; 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 12px;
  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: 7px 16px !important; }
.btn-nav:hover { background: var(--primary-dark) !important; }
.hamburger { display: none; cursor: pointer; font-size: 20px; background: none; border: none; padding: 4px; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #fef9f6 50%, #f0fff8 100%);
  padding: 36px 0 28px;
  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: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.2px;
}
.hero h1 {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  max-width: 640px;
  margin: 0 auto 10px;
}
.hero h1 em { font-style: italic; color: var(--primary); }
.hero p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 20px;
  font-weight: 400;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: nowrap;
}
.hero-stat { display: flex; flex-direction: column; align-items: center; }
.hero-stat strong { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.hero-stat span { font-size: 11px; color: var(--text-muted); }
.hero-divider { width: 1px; height: 24px; background: var(--border); }

/* ── CATEGORY FILTER ── */
.category-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 90;
}
.category-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.category-inner::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  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: 32px 0 64px; }
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-top: 4px;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px;
  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: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
  background: var(--card-bg, var(--primary-light));
  flex-shrink: 0;
}
.tool-name { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; line-height: 1.3; }
.tool-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.tool-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--accent);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tool-badge.free { background: var(--success); }
.tools-section-group { margin-bottom: 40px; }

/* ── TOOL PAGE ── */
.tool-page { min-height: calc(100vh - 56px); }
.tool-hero {
  background: linear-gradient(135deg, #1a56db 0%, #1e429f 100%);
  padding: 24px 0 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.tool-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin: 0 auto 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.tool-hero h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.5px;
  color: white;
}
.tool-hero p {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  max-width: 480px;
  margin: 0 auto;
}
.tool-hero .breadcrumb a { color: rgba(255,255,255,0.7); }
.tool-hero .breadcrumb { color: rgba(255,255,255,0.5); justify-content: center; }
.tool-workspace { max-width: 860px; margin: 0 auto; padding: 36px 24px 72px; }

/* ── DROPZONE ── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 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: 44px; margin-bottom: 14px; display: block; }
.dropzone h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }
.dropzone p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.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: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  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: 13px 28px; font-size: 15px; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── FORM CONTROLS ── */
.form-group { margin-bottom: 18px; }
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  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 13px center;
  padding-right: 34px;
}

/* ── CARD ── */
.card { background: white; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 24px; 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: 24px;
  margin-top: 24px;
  animation: fadeUp 0.3s ease;
}
.result-box h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--primary); margin-bottom: 14px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.result-value { font-size: 32px; font-weight: 700; color: var(--text-primary); font-family: 'DM Serif Display', serif; letter-spacing: -1px; margin-bottom: 4px; }
.result-label { font-size: 12px; color: var(--text-muted); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.result-item { background: white; border-radius: var(--radius-sm); padding: 12px 14px; border: 1px solid rgba(26,86,219,0.1); }
.result-item .val { font-size: 18px; font-weight: 700; color: var(--primary); font-family: 'DM Serif Display', serif; }
.result-item .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── PROGRESS ── */
.progress-bar { height: 6px; background: var(--border); border-radius: 100px; overflow: hidden; margin-top: 14px; }
.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: 18px; display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: white; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.file-item-icon { font-size: 18px; }
.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: 11px; color: var(--text-muted); flex-shrink: 0; }
.file-item-remove { color: var(--text-muted); cursor: pointer; transition: var(--transition); font-size: 16px; 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: 12px 18px; background: var(--text-primary); color: white; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease; max-width: 340px; }
.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: 12px; color: var(--text-muted); padding: 10px 0; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── FOOTER ── */
.footer { background: var(--text-primary); color: rgba(255,255,255,0.7); padding: 40px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 32px; }
.footer-brand .logo { filter: brightness(0) invert(1); margin-bottom: 10px; }
.footer-brand p { font-size: 13px; line-height: 1.7; max-width: 240px; }
.footer h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: white; margin-bottom: 14px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer ul li a { color: rgba(255,255,255,0.6); text-decoration: none; font-size: 13px; transition: var(--transition); }
.footer ul li a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.footer-disclaimer { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 6px; max-width: 600px; }

/* ── SPINNER ── */
.spinner { width: 18px; height: 18px; 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: 18px; height: 18px; 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: 22px; gap: 0; }
.tab-btn { padding: 9px 18px; font-size: 13px; 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); }

/* ── TOGGLE ── */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 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; }
  .header-inner { height: 52px; }
  .category-bar { top: 52px; }
  .hero { padding: 20px 0 16px; }
  .hero h1 { font-size: 20px; letter-spacing: -0.3px; }
  .hero p { font-size: 13px; margin-bottom: 14px; }
  .hero-badge { font-size: 11px; margin-bottom: 8px; }
  .hero-stats { gap: 10px; }
  .hero-stat strong { font-size: 14px; }
  .hero-stat span { font-size: 10px; }
  .hero-divider { height: 20px; }
  .tool-hero { padding: 16px 0 12px; }
  .tool-hero-icon { width: 40px; height: 40px; font-size: 20px; margin-bottom: 8px; }
  .tool-hero h1 { font-size: 18px; }
  .tool-hero p { font-size: 13px; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .result-grid { grid-template-columns: 1fr 1fr; }
  .tool-workspace { padding: 24px 16px 48px; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }
  .tools-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tool-card { padding: 12px; }
  .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: 22px 0; }
