/* FineLoans PropCalc Standalone Web App Stylesheet */

:root {
  --primary-purple: #64498c;
  --primary-hover: #3e1974;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
  --text-main: #0f172a;
  --text-slate: #334155;
  --text-muted: #64748b;
  --border-light: rgba(100, 73, 140, 0.15);
  --card-glass: rgba(255, 255, 255, 0.88);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary-purple);
}

.brand-subtitle {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}

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

.nav-link {
  color: var(--text-slate);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary-purple);
}

.btn-primary {
  background: var(--primary-purple);
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  transition: background-color 0.2s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* Hero & Main Layout */
.hero-section {
  position: relative;
  flex: 1;
  padding: 40px 24px 60px 24px;
  overflow: hidden;
}

.hero-bg-blobs {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
}

.blob-1 {
  top: -100px;
  right: 10%;
  width: 400px;
  height: 400px;
  background: #64498c;
}

.blob-2 {
  bottom: -100px;
  left: 5%;
  width: 350px;
  height: 350px;
  background: #3b82f6;
}

.main-container {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
  position: relative;
  z-index: 1;
}

/* Hero Content (Left) */
.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 10px;
}

.badge {
  display: inline-block;
  align-self: flex-start;
  background: rgba(100, 73, 140, 0.1);
  color: var(--primary-purple);
  border: 1px solid rgba(100, 73, 140, 0.2);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-main);
}

.hero-description {
  font-size: 16px;
  color: var(--text-slate);
  line-height: 1.6;
}

.features-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.feature-item {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.feature-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.feature-item strong {
  font-size: 14px;
  color: var(--text-main);
}

.feature-item p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.cta-card {
  background: white;
  border: 1px solid var(--border-light);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(100, 73, 140, 0.08);
  margin-top: 10px;
}

.cta-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.cta-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.cta-actions {
  display: flex;
  gap: 12px;
}

.btn-call {
  background: var(--primary-purple);
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

.btn-secondary {
  background: rgba(100, 73, 140, 0.1);
  color: var(--primary-purple);
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}

/* Calculator Wrapper & Light Glass Card */
.calc-wrapper {
  display: flex;
  justify-content: center;
}

.calc-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card-glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.calc-header {
  background: rgba(245, 242, 252, 0.8);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(100, 73, 140, 0.12);
}

.calc-header h2 {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.calc-header h2 span {
  color: var(--primary-purple);
}

.sub-by {
  font-size: 11px;
  color: var(--text-slate);
  margin-top: 2px;
}

.sub-by a {
  color: var(--primary-purple);
  font-weight: 700;
  text-decoration: none;
}

.btn-share-main {
  background: rgba(100, 73, 140, 0.12);
  border: 1px solid rgba(100, 73, 140, 0.3);
  color: var(--primary-purple);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-share-main:hover {
  background: var(--primary-purple);
  color: white;
}

/* Tabs */
.calc-tabs {
  display: flex;
  background: rgba(245, 242, 252, 0.6);
  border-bottom: 1px solid rgba(100, 73, 140, 0.12);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-slate);
  padding: 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn.active {
  color: var(--primary-purple);
  border-bottom: 2px solid var(--primary-purple);
  background: rgba(100, 73, 140, 0.12);
}

/* Content Area */
.tab-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-content.hidden {
  display: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 700;
  color: var(--text-slate);
  font-size: 12px;
}

.input-text {
  background: white;
  border: 1px solid #cbd5e1;
  color: var(--text-main);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  outline: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(100, 73, 140, 0.15);
}

.slider-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-slate);
}

.val-badge {
  font-weight: 700;
  color: var(--primary-purple);
}

.sub-row {
  font-size: 11px;
  margin-top: 4px;
}

.input-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #cbd5e1;
  outline: none;
  margin: 6px 0;
}

.input-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-purple);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gap-sm {
  gap: 8px;
}

/* Cashflow Card */
.cashflow-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(100, 73, 140, 0.15);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(100, 73, 140, 0.12);
  margin-bottom: 10px;
}

.card-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.yield-badge {
  background: rgba(100, 73, 140, 0.12);
  color: var(--primary-purple);
  border: 1px solid var(--primary-purple);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.freq-switcher {
  display: flex;
  gap: 4px;
  background: rgba(100, 73, 140, 0.08);
  border: 1px solid rgba(100, 73, 140, 0.15);
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.freq-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-slate);
  padding: 6px 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.freq-btn.active {
  background: var(--primary-purple);
  color: white;
  box-shadow: 0 2px 6px rgba(100, 73, 140, 0.3);
}

.cf-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.cf-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-slate);
}

.total-row {
  border-top: 1px solid rgba(100, 73, 140, 0.12);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 800;
}

.val-purple { color: var(--primary-purple); }
.val-red { color: #dc2626; }
.val-green { color: #059669; }

/* Accordion Details */
.btn-accordion {
  background: transparent;
  border: none;
  color: var(--text-slate);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.accordion-panel {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(100, 73, 140, 0.1);
  font-size: 12px;
}

.accordion-panel.show {
  display: flex;
}

/* Metric Cards */
.metric-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(100, 73, 140, 0.15);
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.03);
}

.metric-card.sm {
  padding: 8px 10px;
}

.metric-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-slate);
  text-transform: uppercase;
}

.metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-purple);
  margin-top: 2px;
}

.metric-val-sm {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.metric-val-purple {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-purple);
  margin-top: 2px;
}

.calc-footer {
  background: rgba(245, 242, 252, 0.8);
  padding: 12px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--text-slate);
  border-top: 1px solid rgba(100, 73, 140, 0.12);
  display: flex;
  justify-content: center;
  gap: 5px;
}

.calc-footer a {
  color: var(--primary-purple);
  font-weight: 700;
  text-decoration: none;
}

.toast {
  position: absolute;
  top: 60px;
  right: 20px;
  background: #0f172a;
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  display: none;
  animation: fadeIn 0.2s ease-out;
}

/* Responsive Breakpoints */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  font-size: 22px;
  color: var(--primary-purple);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

@media (max-width: 992px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 20px 24px;
    gap: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(100, 73, 140, 0.15);
  }

  .nav-links.active {
    display: flex;
  }

  .main-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
  }

  .hero-widget {
    order: -1;
    width: 100%;
  }

  .hero-content {
    order: 1;
    width: 100%;
  }

  .hero-title {
    font-size: 30px;
  }
}

/* iOS Style Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 18px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary-purple);
}
input:checked + .slider:before {
  transform: translateX(16px);
}

.auto-calc-label {
  font-size: 9px;
  color: var(--text-muted);
  background: rgba(100, 73, 140, 0.08);
  border: 1px dashed rgba(100, 73, 140, 0.3);
  border-radius: 4px;
  padding: 1px 4px;
  font-weight: normal;
}
