/* =========================================
   RESET
========================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* =========================================
   CSS VARIABLES
========================================= */

:root {
  --primary: #1889e8;
  --primary-light: #eef8ff;

  --text: #172033;
  --muted: #7b8494;
  --border: #e8ecf2;
  --background: #f8fafc;
  --white: #ffffff;

  --danger: #e85d63;
  --success: #41ad70;
}

/* =========================================
   BASE
========================================= */

body {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Arial,
    sans-serif;
  background: var(--background);
  color: var(--text);
  line-height: 1.5;
}

button,
input {
  font-family: inherit;
}

/* =========================================
   HERO
========================================= */

.hero {
  max-width: 1380px;
  margin: auto;
  padding: 200px 5% 45px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
}

.hero-content {
  max-width: 650px;
}

.hero h1 {
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -2px;
  margin-bottom: 20px;
  font-weight: 600;
}

.hero p {
  color: var(--muted);
  font-size: 17px;
  max-width: 600px;
}

.hero-visual {
  width: 320px;
  height: 250px;
  border-radius: 30px;
  object-fit: cover;
  flex-shrink: 0;
}

.hero-visual2 {
  width: 450px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
  opacity: 0.8;
}

.hero-visual-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero-coin {
  position: absolute;
  pointer-events: none;
}

.hero-coin-1 {
  width: 55px;
  top: 50%;
  transform: translateY(-50%);
  left: -28px;
}

.hero-coin-2 {
  width: 85px;
  right: -30px;
}

/* =========================================
   MAIN LAYOUT
========================================= */

.calculator {
  max-width: 1380px;
  margin: 25px auto 80px;
  padding: 0 5%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: 28px;
  align-items: start;
}

/* =========================================
   INPUT COLUMN
========================================= */

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

.section-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.section-header {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.section-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.section-icon img {
  display: block;
}

.section-body {
  padding: 8px 20px 20px;
}

.input-row {
  min-height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #f0f2f5;
}

.input-row:last-child {
  border-bottom: 0;
}

.input-label {
  font-size: 14px;
  font-weight: 500;
  color: #303846;
}

.input-help {
  display: block;
  color: #6b7280;
  font-size: 11px;
  margin-top: 2px;
}

.money-field {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  max-width: 100%;
  height: 38px;
  background: #f7f8fa;
  border: 1px solid transparent;
  border-radius: 9px;
  overflow: hidden;
}

.money-field:focus-within {
  background: #fff;
  border-color: #9dd5fa;
  box-shadow: 0 0 0 3px #eaf6ff;
}

.money-symbol {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 10px;
  border-right: 1px solid #e4e7eb;
  background: #eef1f4;
  color: #303846;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.money-input {
  width: 7ch;
  min-width: 7ch;
  height: 38px;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  outline: none;
  text-align: right;
  box-sizing: content-box;
}

.money-field .money-input {
  height: 100%;
}

.money-input:focus {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.amount-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7ch;
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #2389dc;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.amount-badge.liability-total {
  background: #fff0f1;
  color: #e56a6f;
}

.add-category {
  margin-top: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  padding: 8px 0;
}

.add-category:hover {
  text-decoration: underline;
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 1000px) {
  .calculator {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  .hero {
    padding-top: 150px;
  }
}

@media (max-width: 650px) {
  .hero {
    padding: 140px 20px 30px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero p {
    font-size: 15px;
  }

  .hero-visual {
    width: 100%;
    height: auto;
  }

  .calculator {
    padding: 0 15px;
  }

  .input-label {
    font-size: 13px;
  }

  .money-input {
    min-width: 7ch;
  }
}
