:root {
  --bg: #0f172a;
  --bg-elevated: #020617;
  --card: #020617;
  --card-alt: #020617;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.12);
  --accent-strong: #0ea5e9;
  --border-subtle: rgba(148, 163, 184, 0.35);
  --text-primary: #e5e7eb;
  --text-muted: #9ca3af;
  --danger: #f97373;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.8);
  --radius-lg: 18px;
  --radius-xl: 24px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #082f49, #020617 50%, #000);
  color: var(--text-primary);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px 16px;
}

.app {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-header {
  text-align: left;
}

.app-header h1 {
  margin: 0 0 4px;
  font-size: 2.1rem;
  letter-spacing: -0.03em;
}

.app-header p {
  margin: 0;
  color: var(--text-muted);
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
}

.card {
  background: radial-gradient(circle at top left, #020617, #020617 45%, #020617);
  border-radius: var(--radius-xl);
  padding: 22px 22px 20px;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.card h2 {
  margin: 0 0 14px;
  font-size: 1.1rem;
}

.card-input {
  background:
    radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.16), transparent 60%),
    linear-gradient(135deg, #020617, #020617);
}

.card-output {
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(circle at bottom left, rgba(8, 47, 73, 0.7), transparent 60%),
    linear-gradient(135deg, #020617, #020617);
}

.field-group {
  margin-bottom: 14px;
}

.field-group.inline {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

input,
select,
button {
  font-family: inherit;
}

.input-with-prefix,
.input-with-suffix {
  display: flex;
  align-items: stretch;
}

.input-with-prefix .prefix,
.input-with-suffix .suffix {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  border-right: none;
  font-size: 0.85rem;
  color: var(--text-muted);
  backdrop-filter: blur(12px);
}

.input-with-suffix .suffix {
  border-radius: 999px;
  border-left: none;
}

.input-with-prefix input,
.input-with-suffix input {
  flex: 1;
  min-width: 0;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 9px 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.65);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-with-prefix input {
  border-left: none;
}

.input-with-suffix input {
  border-right: none;
}

.input-with-prefix input:focus,
.input-with-suffix input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
  background: rgba(15, 23, 42, 0.9);
}

select {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(51, 65, 85, 0.9);
  padding: 9px 11px;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: rgba(15, 23, 42, 0.65);
  outline: none;
}

.tabs {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(51, 65, 85, 0.9);
  margin-bottom: 8px;
}

.tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab-active {
  background: var(--accent-strong);
  color: #0b1120;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.75);
}

.tab-panel {
  display: none;
}

.tab-panel-active {
  display: block;
}

.btn-primary {
  width: 100%;
  margin-top: 6px;
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-strong), #22c55e);
  color: #020617;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.5);
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.08s ease-out;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 16px 40px rgba(34, 197, 94, 0.65);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.45);
}

.payment-highlight {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 16px;
  margin: 4px 0 14px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.24), transparent 60%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.32), transparent 65%),
    rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.payment-highlight .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.payment-highlight .value {
  font-size: 1.6rem;
  font-weight: 700;
}

.payment-breakdown {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.75);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 2px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.breakdown-row span:last-child {
  color: var(--text-primary);
}

.summary {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.summary p {
  margin: 4px 0;
}

.disclaimer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: rgba(2, 6, 23, 0.75);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.app-footer p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.policy-page {
  width: 100%;
  max-width: 860px;
}

.policy-content {
  line-height: 1.65;
  color: var(--text-primary);
}

.policy-content p {
  color: var(--text-muted);
}

.policy-content ul {
  color: var(--text-muted);
  padding-left: 22px;
}

@media (max-width: 900px) {
  body {
    padding: 20px 12px 24px;
  }

  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    padding: 18px 16px 16px;
  }
}

@media (max-width: 600px) {
  .app-header h1 {
    font-size: 1.6rem;
  }

  .field-group.inline {
    grid-template-columns: minmax(0, 1fr);
  }
}
