:root {
  --bg: #0a0f1f;
  --bg-deep: #050816;
  --panel: rgba(12, 18, 38, 0.75);
  --panel-strong: rgba(16, 24, 48, 0.92);
  --border: rgba(255, 255, 255, 0.12);
  --text: #f5f7ff;
  --muted: #a4b0d3;
  --accent: #7cf2c3;
  --accent-strong: #23c993;
  --accent-warm: #ff8f70;
  --accent-cool: #70d7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 242, 195, 0.18), transparent 26%),
    radial-gradient(circle at 85% 15%, rgba(112, 215, 255, 0.18), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 143, 112, 0.18), transparent 28%),
    linear-gradient(135deg, var(--bg), var(--bg-deep));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 90%);
  pointer-events: none;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 48px 22px;
  isolation: isolate;
}

.mesh {
  position: fixed;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
  animation: drift 14s ease-in-out infinite;
}

.mesh-one {
  top: 100px;
  left: -60px;
  width: 260px;
  height: 260px;
  background: rgba(124, 242, 195, 0.18);
}

.mesh-two {
  top: 260px;
  right: 4%;
  width: 320px;
  height: 320px;
  background: rgba(112, 215, 255, 0.15);
  animation-delay: -4s;
}

.mesh-three {
  bottom: 40px;
  left: 45%;
  width: 280px;
  height: 280px;
  background: rgba(255, 143, 112, 0.14);
  animation-delay: -8s;
}

.app-shell {
  width: min(1240px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
}

.hero-panel,
.calculator-panel {
  position: relative;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(20, 28, 55, 0.9), rgba(10, 15, 31, 0.82));
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: panel-in 0.8s ease both;
}

.hero-panel {
  padding: 34px;
  border-radius: 32px;
  min-height: 640px;
  position: sticky;
  top: 24px;
}

.hero-panel::after,
.calculator-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%);
  pointer-events: none;
}

.calculator-panel {
  padding: 30px;
  border-radius: 32px;
  animation-delay: 0.15s;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1,
h2,
.note-label {
  font-family: "Syne", "Space Grotesk", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  line-height: 0.92;
  max-width: 8ch;
}

h2 {
  margin: 6px 0 0;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1;
}

.hero-copy {
  max-width: 34ch;
  margin: 18px 0 30px;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-stats {
  display: grid;
  gap: 14px;
}

.stat-card {
  position: relative;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: auto 16px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.hero-tip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(124, 242, 195, 0.09);
  color: #ddffef;
  border: 1px solid rgba(124, 242, 195, 0.18);
}

.tip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 16px rgba(124, 242, 195, 0.7);
  animation: pulse 1.8s ease-in-out infinite;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

button {
  border: 0;
  border-radius: 16px;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--accent-warm), #ffb68f);
  color: #20151a;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(255, 143, 112, 0.26);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(255, 143, 112, 0.32);
  filter: saturate(1.08);
}

button:active {
  transform: translateY(0);
}

.cash-grid {
  display: grid;
  gap: 16px;
}

.note-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(140px, 0.7fr) minmax(120px, 0.6fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(16px);
  opacity: 0;
  animation: card-in 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) forwards;
  animation-delay: calc(var(--delay) * 0.07s + 0.18s);
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.note-card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 242, 195, 0.26);
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.22);
}

.note-card.is-active {
  border-color: rgba(124, 242, 195, 0.34);
  background: linear-gradient(135deg, rgba(124, 242, 195, 0.15), rgba(112, 215, 255, 0.08));
  box-shadow: 0 20px 40px rgba(35, 201, 147, 0.12);
}

.note-visual {
  display: flex;
  align-items: center;
  gap: 14px;
}

.note-visual img {
  width: clamp(72px, 10vw, 108px);
  height: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
  transform-origin: center;
  transition: transform 0.3s ease;
}

.note-card:hover .note-visual img,
.note-card.is-active .note-visual img {
  transform: rotate(-2deg) scale(1.03);
}

.note-label {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: 0.02em;
}

.note-caption {
  color: var(--muted);
  font-size: 0.92rem;
}

.count-field,
.note-total {
  display: grid;
  gap: 8px;
}

.field-label {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.cash-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 10, 20, 0.55);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.cash-input::placeholder {
  color: rgba(164, 176, 211, 0.55);
}

.cash-input:focus {
  border-color: rgba(112, 215, 255, 0.55);
  box-shadow: 0 0 0 4px rgba(112, 215, 255, 0.14);
  transform: translateY(-1px);
}

.cash-input::-webkit-outer-spin-button,
.cash-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cash-input[type="number"] {
  -moz-appearance: textfield;
}

.cash-text {
  font-size: 1.06rem;
  font-weight: 700;
  color: #eef1ff;
}

.note-card.is-active .cash-text {
  color: #dffff4;
}

.result-part {
  position: relative;
  margin-top: 22px;
  padding: 24px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 143, 112, 0.24), rgba(112, 215, 255, 0.18)),
    rgba(14, 21, 43, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.25);
}

.result-part::before {
  content: "";
  position: absolute;
  inset: -120% auto auto -30%;
  width: 42%;
  height: 320%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  opacity: 0;
  transform: rotate(18deg);
}

.result-part.is-updated::before {
  animation: sweep 0.8s ease;
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.result-label {
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

#txtFinalCash {
  font-family: "Syne", "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  text-align: right;
}

#txtFinalCashInWords {
  margin: 0;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -24px, 0) scale(1.06);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.8;
  }
}

@keyframes sweep {
  0% {
    opacity: 0;
    transform: translateX(-50%) rotate(18deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(360%) rotate(18deg);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: auto;
    position: relative;
    top: 0;
  }

  .note-card {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.8fr) minmax(110px, 0.55fr);
  }
}

@media (max-width: 700px) {
  .page-shell {
    padding: 26px 14px;
  }

  .hero-panel,
  .calculator-panel {
    padding: 22px;
    border-radius: 24px;
  }

  .panel-heading,
  .result-head {
    flex-direction: column;
    align-items: flex-start;
  }

  button {
    width: 100%;
  }

  .note-card {
    grid-template-columns: 1fr;
  }

  .note-total {
    padding-top: 4px;
  }

  #txtFinalCash {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
