:root {
  --navy: #001f3f;
  --gold: #ffd700;
  --white: #ffffff;
  --gray: #f5f5f5;
  --dark-navy: #0a1f3f;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Open Sans", sans-serif;
  line-height: 1.6;
  color: var(--navy);
  background: linear-gradient(180deg, #f7f8fb 0%, #e7ebf3 100%);
}

h1 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 4px;
  text-align: center;
}

h2.subtitle {
  font-family: "Montserrat", sans-serif;
  font-weight: 600;
  font-size: 1.9rem;
  margin-bottom: 12px;
  text-align: center;
  color: var(--navy);
}

.subtitle-note {
  text-align: center;
  font-size: 1.05rem;
  margin-bottom: 32px;
  color: rgba(0, 31, 63, 0.8);
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 20px;
}

.calculator {
  width: min(760px, 100%);
}

.financial-form {
  background: var(--navy);
  padding: 50px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  color: var(--white);
}

.field {
  margin-bottom: 26px;
}

.question {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.asterisk {
  color: var(--gold);
}

select,
input {
  width: 100%;
  padding: 18px 18px 18px 50px;
  border-radius: 12px;
  background: #162a4d;
  color: #f4f7ff;
  font-size: 1.2rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

select {
  padding-left: 18px;
}

select:focus,
input:focus {
  outline: 2px solid rgba(255, 215, 0, 0.65);
  outline-offset: 2px;
}

.currency-input-group {
  position: relative;
}

.currency-input-group::before {
  content: "$";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--white);
  pointer-events: none;
}

.field-hint {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.8;
}

.actions {
  margin-top: 30px;
  text-align: center;
}

.btn {
  background: var(--gold);
  color: var(--navy);
  padding: 16px 46px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  border: none;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn:hover {
  background: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.form-error {
  margin-top: 16px;
  color: #ffe08a;
  font-weight: 600;
  min-height: 20px;
  text-align: center;
}

.result {
  margin-top: 30px;
  padding: 30px;
  border-radius: 20px;
  background: var(--navy);
  color: var(--white);
  text-align: center;
  box-shadow: var(--shadow);
  display: none;
}

.result h2 {
  color: var(--gold);
  font-size: 2rem;
  margin-bottom: 8px;
}

.result .amount {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  margin: 16px 0;
}

.result .statement-type {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.result .note {
  font-size: 1rem;
  opacity: 0.85;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--navy);
  color: var(--white);
  padding: 36px;
  border-radius: 20px;
  width: min(520px, 92vw);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  z-index: 1;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.modal.is-open .modal-content {
  transform: translateY(0);
  opacity: 1;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--white);
  font-size: 1.8rem;
  cursor: pointer;
}

.modal-loading p {
  margin-top: 18px;
  font-size: 1.1rem;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  margin: 0 auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-result h2 {
  color: var(--gold);
  font-size: 1.8rem;
  margin-bottom: 8px;
  white-space: nowrap;
}

.modal-result {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-result.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-result .amount {
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  margin: 16px 0;
}

.modal-result .statement-type {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.modal-result .note {
  font-size: 1rem;
  opacity: 0.85;
  margin-bottom: 20px;
}

.modal-result .cta {
  display: inline-block;
  margin-top: 10px;
}

.trust-note {
  margin-top: 16px;
  font-size: 0.95rem;
  opacity: 0.85;
}

.cta-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.cta-primary {
  width: 100%;
}

.cta-secondary {
  width: 100%;
  background: transparent;
  color: var(--gold);
  border: 2px solid var(--gold);
  box-shadow: none;
}

.cta-secondary:hover {
  background: rgba(255, 215, 0, 0.12);
}

@media (max-width: 640px) {
  .financial-form {
    padding: 32px 24px;
  }

  h1 {
    font-size: 2rem;
  }
}
