/*
 * ============================================================
 *  AutoPrime — EMI Calculator Page CSS
 *  public/css/emi.css
 *
 *  Depends on: autoprime-frontend.css (must load first)
 *  Used by: resources/views/frontend/emi.blade.php
 * ============================================================
 */

/* ── Hero ─────────────────────────────────────────────────── */
.emi-hero {
  background: linear-gradient(130deg, #0f172a 0%, #1a2c4e 55%, #1d3557 100%);
  padding: 72px 0 60px;
  position: relative;
  overflow: hidden;
}
.emi-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?q=80&w=1911&auto=format&fit=crop')
              center / cover no-repeat;
  opacity: 0.07;
}
.emi-hero-inner {
  position: relative;
  text-align: center;
}
.emi-hero-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.85);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: .04em;
}
.emi-hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 16px;
}
.emi-hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,.55);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Section wrapper ─────────────────────────────────────── */
.emi-section {
  padding: 56px 0 80px;
  background: var(--ap-bg);
}

/* ── Input card ──────────────────────────────────────────── */
.emi-card {
  background: white;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,.07);
  border: 1.5px solid var(--ap-border);
}
.emi-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ap-navy);
  margin-bottom: 28px;
}

/* ── Slider field ────────────────────────────────────────── */
.emi-field {
  margin-bottom: 28px;
}
.emi-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.emi-label {
  font-size: .88rem;
  font-weight: 600;
  color: var(--ap-navy);
}
.emi-value-badge {
  background: var(--ap-navy);
  color: white;
  border-radius: 8px;
  padding: 4px 14px;
  font-size: .88rem;
  font-weight: 700;
  min-width: 90px;
  text-align: center;
  font-family: 'Syne', sans-serif;
}

/* Custom range slider */
.emi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 10px;
  background: var(--ap-border);
  outline: none;
  cursor: pointer;
}
.emi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--ap-navy);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  transition: transform .15s;
}
.emi-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.emi-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--ap-navy);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.emi-slider-ends {
  display: flex;
  justify-content: space-between;
  font-size: .74rem;
  color: var(--ap-muted);
  margin-top: 6px;
}

/* Tenure quick-pick chips */
.tenure-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.tenure-chip {
  background: var(--ap-bg);
  border: 1.5px solid var(--ap-border);
  border-radius: 50px;
  padding: 5px 14px;
  font-size: .79rem;
  font-weight: 600;
  color: var(--ap-navy);
  cursor: pointer;
  transition: all .18s;
}
.tenure-chip:hover   { border-color: var(--ap-navy); background: #eef1f9; }
.tenure-chip.active  { background: var(--ap-navy); color: white; border-color: var(--ap-navy); }

/* Reset button */
.emi-reset-btn {
  width: 100%;
  background: none;
  border: 1.5px solid var(--ap-border);
  border-radius: 12px;
  padding: 11px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ap-muted);
  cursor: pointer;
  transition: all .18s;
  margin-top: 6px;
}
.emi-reset-btn:hover { border-color: var(--ap-navy); color: var(--ap-navy); }

/* ── Result hero ─────────────────────────────────────────── */
.emi-result-hero {
  background: var(--ap-navy);
  border-radius: 24px;
  padding: 32px 28px;
  text-align: center;
  color: white;
  margin-bottom: 16px;
}
.erh-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,.55);
  margin-bottom: 8px;
}
.erh-amount {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  color: white;
}
.erh-sub {
  font-size: .85rem;
  color: rgba(255,255,255,.45);
  margin-top: 8px;
}

/* ── Breakdown grid ──────────────────────────────────────── */
.emi-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.ebd-card {
  background: white;
  border: 1.5px solid var(--ap-border);
  border-radius: 16px;
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow .2s;
}
.ebd-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.ebd-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ebd-label {
  font-size: .74rem;
  color: var(--ap-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.ebd-val {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ap-navy);
}

/* ── Pie chart ───────────────────────────────────────────── */
.emi-chart-wrap {
  background: white;
  border: 1.5px solid var(--ap-border);
  border-radius: 20px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 16px;
}
.emi-chart-wrap canvas { flex-shrink: 0; }
.emi-chart-legend { flex: 1; }
.ecl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .88rem;
  color: var(--ap-text);
  margin-bottom: 10px;
}
.ecl-item strong { margin-left: auto; font-family: 'Syne', sans-serif; font-size: 1.05rem; }
.ecl-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── CTA button ──────────────────────────────────────────── */
.emi-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: linear-gradient(135deg, var(--ap-navy), #2d4a8a);
  color: white;
  border-radius: 14px;
  padding: 15px 20px;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .2s, transform .15s;
}
.emi-cta-btn:hover { opacity: .88; transform: translateY(-2px); color: white; }

/* ── Amortisation table ──────────────────────────────────── */
.emi-table-section {
  background: white;
  border-radius: 24px;
  border: 1.5px solid var(--ap-border);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.05);
}
.emi-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px 16px;
  border-bottom: 1.5px solid var(--ap-border);
}
.emi-table-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ap-navy);
  margin: 0;
}
.emi-table-sub { font-size: .82rem; color: var(--ap-muted); }
.emi-table-wrap { overflow-x: auto; }
.emi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.emi-table thead tr {
  background: var(--ap-bg);
}
.emi-table th {
  padding: 12px 20px;
  text-align: left;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ap-muted);
  white-space: nowrap;
}
.emi-table td {
  padding: 12px 20px;
  border-top: 1px solid var(--ap-border);
  color: var(--ap-text);
  white-space: nowrap;
}
.emi-table tbody tr:hover { background: #f8fafc; }
.emi-td-num {
  font-weight: 700;
  color: var(--ap-muted) !important;
  font-size: .82rem;
}
.emi-table-note {
  padding: 14px 28px;
  font-size: .82rem;
  color: var(--ap-muted);
  border-top: 1.5px solid var(--ap-border);
}
.emi-link-btn {
  background: none;
  border: none;
  color: var(--ap-navy);
  font-weight: 700;
  cursor: pointer;
  font-size: .82rem;
  text-decoration: underline;
  padding: 0;
}
.emi-link-btn:hover { color: var(--ap-blue); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 576px) {
  .emi-breakdown-grid { grid-template-columns: 1fr 1fr; }
  .emi-chart-wrap { flex-direction: column; text-align: center; }
  .ecl-item strong { margin-left: 8px; }
  .emi-table th, .emi-table td { padding: 10px 12px; }
}
