/* Reset-ish base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #18213a 0, #050711 55%, #050509 100%);
  color: #f7f9ff;
}

/* Layout */

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem clamp(1.25rem, 4vw, 3.5rem);
}

.app-header {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto 1.75rem auto;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.brand-logo {
  width: 24px;
  height: 24px;
}

.brand-name {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9fb0ff;
}

.app-title {
  margin: 0.1rem 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.app-subtitle {
  margin: 0.25rem 0 0;
  color: #c1cae7;
  font-size: 0.95rem;
}

.app-main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel--info {
    order: 2;
  }

  .panel--calculator {
    order: 1;
  }
}

/* Panels */

.panel {
  background: rgba(4, 6, 22, 0.92);
  border-radius: 16px;
  border: 1px solid rgba(108, 123, 255, 0.1);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6);
  padding: 1.5rem;
}

.panel--info {
  align-self: flex-start;
}

.panel--calculator {
  padding: 1.25rem;
}

.panel-inner {
  display: grid;
  gap: 1.5rem;
}

/* Info panel */

.panel-title {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.panel--info p {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: #d1d7f3;
  font-size: 0.95rem;
  line-height: 1.5;
}

.feature-list {
  padding-left: 1.1rem;
  margin: 0;
  list-style: disc;
  color: #c8d1ff;
  font-size: 0.9rem;
}

.feature-list li {
  margin-bottom: 0.25rem;
}

/* Sections */

.section-heading {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #9fb0ff;
  margin: 0 0 0.75rem;
}

/* Fields */

.inputs,
.results {
  background: radial-gradient(circle at top left, #141d33 0, #050816 80%);
  border-radius: 14px;
  padding: 1.25rem;
  border: 1px solid rgba(111, 128, 255, 0.2);
}

.inputs {
  margin-bottom: 0.75rem;
}

.field {
  margin-bottom: 1rem;
}

.fieldset {
  border: none;
  padding: 0;
}

.field-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.field-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(146, 162, 255, 0.35);
  background-color: rgba(3, 8, 28, 0.9);
  color: #f7f9ff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.field-input:focus-visible {
  border-color: #4a7bff;
  box-shadow: 0 0 0 1px rgba(74, 123, 255, 0.6);
}

.field-input::placeholder {
  color: #7e8bbd;
}

.field-input--short {
  max-width: 72px;
}

.field-input--compact {
  font-size: 0.9rem;
  padding-block: 0.45rem;
}

.field-input--center {
  text-align: center;
}

.field-error {
  margin: 0.25rem 0 0;
  color: #ff8080;
  font-size: 0.8rem;
  min-height: 1em;
}

.field-hint {
  margin: 0.25rem 0 0;
  color: #9aa6d8;
  font-size: 0.8rem;
}

/* Tip buttons */

.tip-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .tip-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.tip-btn {
  border-radius: 9px;
  padding: 0.45rem 0.4rem;
  border: 1px solid rgba(148, 166, 255, 0.3);
  background: radial-gradient(circle at top left, #151d33 0, #050816 80%);
  color: #dfe5ff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.05s ease;
}

.tip-btn:hover {
  border-color: rgba(121, 172, 255, 0.8);
}

.tip-btn:active {
  transform: translateY(1px);
}

.tip-btn.active {
  background: linear-gradient(135deg, #4d7bff, #2bd1ff);
  color: #050715;
  border-color: transparent;
  font-weight: 600;
}

.tip-custom {
  grid-column: span 2;
}

@media (max-width: 640px) {
  .tip-custom {
    grid-column: span 3;
  }
}

/* Steppers */

.stepper {
  display: inline-flex;
  align-items: stretch;
  border-radius: 999px;
  border: 1px solid rgba(140, 158, 255, 0.6);
  overflow: hidden;
  background: rgba(4, 8, 28, 0.95);
}

.stepper-btn {
  width: 40px;
  border: none;
  background: transparent;
  color: #dfe5ff;
  font-size: 1.2rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.1s ease;
}

.stepper-btn:hover {
  background: rgba(60, 94, 255, 0.26);
}

.stepper .field-input {
  border-radius: 0;
  border: none;
  width: 72px;
  background-color: transparent;
}

/* Choices (rounding) */

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

@media (max-width: 640px) {
  .choice-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.5rem;
  border-radius: 99px;
  background: rgba(16, 23, 50, 0.9);
  border: 1px solid rgba(132, 148, 255, 0.4);
  font-size: 0.85rem;
}

.choice input {
  accent-color: #4d7bff;
}

/* Inline row (tax & service) */

.inline-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.inline-suffix {
  font-size: 0.88rem;
  color: #d7defd;
}

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #d1dafd;
}

.inline-label input {
  accent-color: #4d7bff;
}

/* Buttons */

.actions-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 1.1rem;
}

.btn {
  border-radius: 999px;
  border: none;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.05s ease, box-shadow 0.1s ease,
    background 0.15s ease, color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(135deg, #4d7bff, #31e4ff);
  color: #050815;
  box-shadow: 0 10px 25px rgba(52, 114, 255, 0.5);
}

.btn--primary:hover {
  box-shadow: 0 12px 30px rgba(52, 116, 255, 0.7);
}

.btn--ghost {
  background: transparent;
  color: #e0e6ff;
  border: 1px solid rgba(139, 152, 255, 0.5);
}

.btn--ghost:hover {
  background: rgba(31, 40, 77, 0.9);
}

#copyBtn.copied {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 10px 25px rgba(46, 204, 113, 0.5);
}

/* Results */

.results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 0.85rem;
  margin: 0;
}

.results-item {
  background: rgba(7, 12, 34, 0.95);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(116, 136, 255, 0.35);
}

.results-item--wide {
  grid-column: span 2;
}

.results-item dt {
  font-size: 0.8rem;
  color: #aab5f5;
  margin-bottom: 0.2rem;
}

.results-item dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.results-summary {
  margin-top: 0.9rem;
  color: #c3cffc;
  font-size: 0.9rem;
}

/* Footer */

.app-footer {
  max-width: 1100px;
  width: 100%;
  margin: 1.5rem auto 0;
  text-align: center;
  color: #9ca7d4;
  font-size: 0.8rem;
}

/* Accessibility helpers */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
