:root {
  --bg: #050b1a;
  --card: rgba(17, 26, 46, 0.88);
  --card-border: rgba(120, 140, 180, 0.22);
  --input: rgba(26, 36, 58, 0.95);
  --input-border: rgba(140, 160, 200, 0.28);
  --text: #ffffff;
  --text-muted: #8b97b0;
  --gold: #c9a227;
  --gold-strong: #d4af37;
  --danger: #e74c3c;
  --radius: 12px;
  --max-width: 520px;
  --chart-height: clamp(340px, 58vw, 560px);
  --earth-height: clamp(220px, 42vw, 420px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
}

/* Top financial chart — visible behind header / promo */
.bg-chart {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--chart-height);
  background-image: url("/static/images/chart.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

/* Soft fade only near the bottom edge — keep chart visible under promo */
.bg-chart::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28%;
  background: linear-gradient(
    180deg,
    rgba(5, 11, 26, 0) 0%,
    rgba(5, 11, 26, 0.35) 55%,
    rgba(5, 11, 26, 0.92) 100%
  );
}

/* Earth footer — city lights sit under notice / version */
.bg-earth {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--earth-height);
  background-image: url("/static/images/earth.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
}

/* Soften busy city lights under text */
.bg-earth::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 11, 26, 1) 0%,
    rgba(5, 11, 26, 0.72) 28%,
    rgba(5, 11, 26, 0.25) 58%,
    rgba(5, 11, 26, 0.1) 100%
  );
}

.container {
  position: relative;
  z-index: 1;
  width: min(100%, var(--max-width));
  margin: 0 auto;
  /* Top: sit on chart with breathing room; bottom: clear earth horizon */
  padding: 20px 16px calc(var(--earth-height) * 0.42 + 48px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #0b0b0b;
  border: 1px solid rgba(201, 162, 39, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}

.lang-switch {
  position: relative;
}

.lang-btn {
  appearance: none;
  background: rgba(5, 11, 26, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.lang-btn svg {
  width: 12px;
  height: 12px;
  opacity: 0.9;
}

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 120px;
  background: rgba(18, 27, 47, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  z-index: 20;
}

.lang-option {
  display: block;
  padding: 10px 14px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
}

.lang-option:hover,
.lang-option.active {
  background: rgba(201, 162, 39, 0.18);
  color: #ffd76a;
}

.promo {
  border-left: 3px solid var(--gold);
  padding: 10px 12px 10px 14px;
  margin: 100px 0 22px;
  background: rgba(4, 18, 60, .58);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-radius: 0 10px 10px 0;
}

.promo h1 {
  color: var(--gold-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 4px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.promo p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.5;
}

.alert {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.alert-success {
  background: rgba(46, 204, 113, 0.18);
  border: 1px solid rgba(46, 204, 113, 0.35);
  color: #7dffa8;
}

.alert-error {
  background: rgba(231, 76, 60, 0.18);
  border: 1px solid rgba(231, 76, 60, 0.35);
  color: #ffb4ab;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.field-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.field-label .icon {
  width: 18px;
  height: 18px;
  color: var(--gold-strong);
  flex-shrink: 0;
}

.field-label .icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.req {
  color: var(--danger);
  margin-left: 2px;
}

.field-input,
.field-textarea {
  width: 100%;
  background: var(--input);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-textarea {
  min-height: 88px;
  resize: vertical;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
}

.field-input:focus,
.field-textarea:focus {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.12);
}

.submit-btn {
  appearance: none;
  width: 100%;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #d4b24a 0%, #c5a044 55%, #b8962e 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(197, 160, 68, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease;
  text-decoration: none;
}

.submit-btn:hover {
  filter: brightness(1.05);
}

.submit-btn:active {
  transform: translateY(1px);
}

.notice {
  margin-top: 28px;
  text-align: center;
  padding: 16px 12px 8px;
  border-radius: 12px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.notice h2 {
  color: var(--gold-strong);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.notice p {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 10px;
}

.version {
  margin-top: 14px;
  color: rgba(200, 210, 230, 0.65);
  font-size: 12px;
  letter-spacing: 0.4px;
}

@media (min-width: 768px) {
  :root {
    --chart-height: clamp(400px, 48vw, 620px);
    --earth-height: clamp(280px, 36vw, 480px);
  }

  .container {
    padding: 28px 20px calc(var(--earth-height) * 0.38 + 64px);
  }

  .promo h1 {
    font-size: 18px;
  }

  .bg-chart {
    background-size: 100% auto;
    background-position: center top;
  }
}

@media (max-width: 480px) {
  .bg-chart {
    background-size: cover;
    background-position: 55% top;
  }

  .bg-earth {
    background-position: center 70%;
  }

  .container {
    padding-bottom: calc(var(--earth-height) * 0.48 + 36px);
  }
}
