/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:           #0d0f14;
  --surface:      #13161e;
  --surface-2:    #1a1e2a;
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --accent:       #6c63ff;
  --accent-soft:  rgba(108,99,255,0.15);
  --green:        #22d3a5;
  --green-soft:   rgba(34,211,165,0.12);
  --gold:         #f5a623;
  --gold-soft:    rgba(245,166,35,0.12);

  --text-primary:   #f0f2f8;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;

  --contributed-color: #6c63ff;
  --interest-color:    #22d3a5;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 4px 32px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.25);

  --transition: 0.2s ease;
  --font: 'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* =============================================
   BACKGROUND
   ============================================= */
.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(108,99,255,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(34,211,165,0.12) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* =============================================
   LAYOUT
   ============================================= */
.container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* =============================================
   CARD
   ============================================= */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  transition: border-color var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
}

/* =============================================
   HEADER
   ============================================= */
.header {
  text-align: center;
  padding: 24px 0 8px;
}

.header-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #f0f2f8 30%, #6c63ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* =============================================
   SECTION TITLE
   ============================================= */
.section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* =============================================
   INPUTS
   ============================================= */
.inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  pointer-events: none;
  user-select: none;
}

.input-wrapper input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  padding: 13px 14px 13px 38px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  -moz-appearance: textfield;
}

.input-wrapper input::-webkit-outer-spin-button,
.input-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.input-wrapper input:hover {
  border-color: var(--border-hover);
  background: #1e2330;
}

.input-wrapper input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,0.2);
  background: #1e2330;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =============================================
   SUMMARY ROW
   ============================================= */
.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition);
}

.summary-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.card--contributed { border-left: 3px solid var(--contributed-color); }
.card--interest    { border-left: 3px solid var(--interest-color); }
.card--total       { border-left: 3px solid var(--gold); }

.summary-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
}

.summary-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.summary-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  white-space: nowrap;
}

.summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  transition: all 0.4s ease;
  white-space: nowrap;
}

.card--contributed .summary-value { color: #a89fff; }
.card--interest    .summary-value { color: var(--green); }
.card--total       .summary-value { color: var(--gold); }

/* =============================================
   YEARS BADGE
   ============================================= */
.years-badge {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 4px 0;
}

.years-icon { font-size: 1rem; }

/* =============================================
   CHARTS ROW
   ============================================= */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 20px;
  align-items: start;
}

.chart-card {
  display: flex;
  flex-direction: column;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.chart-container {
  position: relative;
  width: 100%;
}

.pie-container {
  max-width: 240px;
  margin: 0 auto;
}

.line-container {
  height: 280px;
}

/* =============================================
   PIE LEGEND
   ============================================= */
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-label {
  color: var(--text-secondary);
  flex: 1;
}

.legend-pct {
  font-weight: 700;
  color: var(--text-primary);
}

/* =============================================
   FOOTER NOTE
   ============================================= */
.footer-note {
  text-align: center;
  padding: 8px 0 0;
}

.footer-note p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.footer-note strong {
  color: var(--text-secondary);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card {
  animation: fadeUp 0.5s ease both;
}

.inputs-card { animation-delay: 0.05s; }
.summary-row .card:nth-child(1) { animation-delay: 0.10s; }
.summary-row .card:nth-child(2) { animation-delay: 0.15s; }
.summary-row .card:nth-child(3) { animation-delay: 0.20s; }
.chart-card--pie  { animation-delay: 0.25s; }
.chart-card--line { animation-delay: 0.30s; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 820px) {
  .summary-row {
    grid-template-columns: 1fr;
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
  .pie-container {
    max-width: 200px;
  }
  .line-container {
    height: 220px;
  }
}

@media (max-width: 540px) {
  .container { padding: 32px 16px 48px; gap: 20px; }
  .card { padding: 20px; }
  .summary-card { padding: 18px; }
  .summary-value { font-size: 1.1rem; }
  h1 { font-size: 1.6rem; }
}
