* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f5f7fb;
  color: #1a1a2e;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  padding: 20px;
  text-align: center;
}

header a {
  color: #fff;
  text-decoration: none;
  font-size: 22px;
  font-weight: bold;
}

header p { font-size: 14px; opacity: 0.9; margin-top: 4px; }

main { flex: 1; padding: 30px 20px; }

.container { max-width: 720px; margin: 0 auto; }

h1 {
  font-size: 28px;
  color: #1e40af;
  text-align: center;
  margin-bottom: 8px;
}

.subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 30px;
  font-size: 15px;
}

.calculator-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 24px;
}

.section-title {
  font-size: 15px;
  color: #1e40af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eff6ff;
}

.section-title:first-child { margin-top: 0; }

label {
  display: block;
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
  margin-top: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: inherit;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hint {
  display: block;
  font-size: 12px;
  color: #777;
  margin-top: 4px;
  font-style: italic;
}

button {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 24px;
  transition: background 0.2s;
}

button:hover { background: #1e40af; }

#results { display: none; }
#results.visible { display: block; }

.results-card {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-top: 4px solid #2563eb;
}

.total-payment {
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-radius: 10px;
  margin-bottom: 24px;
}

.total-label {
  font-size: 14px;
  color: #1e40af;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.total-value {
  font-size: 42px;
  font-weight: bold;
  color: #1e40af;
  margin: 8px 0;
}

.total-sublabel {
  font-size: 13px;
  color: #666;
}

.breakdown { margin-bottom: 20px; }

.line {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 15px;
}

.line:last-child { border-bottom: none; }

.line strong { color: #1e40af; }

.line-total {
  border-top: 2px solid #1e40af;
  border-bottom: none;
  margin-top: 8px;
  padding-top: 12px;
  font-weight: bold;
  font-size: 16px;
}

.line-total strong { font-size: 17px; }

.alert {
  padding: 16px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.alert-warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  color: #78350f;
}

.alert-success {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.disclaimer {
  margin-top: 24px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

footer {
  text-align: center;
  padding: 24px 20px;
  font-size: 13px;
  color: #999;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
}

footer a {
  color: #2563eb;
  text-decoration: none;
  margin: 0 6px;
}

footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  h1 { font-size: 22px; }
  .total-value { font-size: 32px; }
  .calculator-card, .results-card { padding: 20px; }
  .line { font-size: 14px; }
}