:root {
  --bg: #07090c;
  --bg-elevated: #0e1318;
  --card: rgba(16, 20, 26, 0.72);
  --card-solid: #12171d;
  --line: rgba(201, 162, 39, 0.18);
  --line-strong: rgba(201, 162, 39, 0.42);
  --gold: #c9a227;
  --gold-bright: #e8c547;
  --gold-soft: rgba(201, 162, 39, 0.14);
  --text: #f4f1ea;
  --muted: #9aa3ad;
  --green: #1f9d55;
  --green-deep: #0f6b38;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --font-ui: "Vazirmatn", "Outfit", Tahoma, sans-serif;
  --font-display: "Cormorant Garamond", "Vazirmatn", Georgia, serif;
  --font-logo: "Outfit", "Vazirmatn", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  color: var(--text);
  font-family: var(--font-ui);
  font-weight: 400;
  background: #05070a;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

html[lang="en"] body,
html[dir="ltr"] body {
  --font-ui: "Outfit", "Vazirmatn", sans-serif;
}

/* Ambient luxury backdrop */
.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 162, 39, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(80, 100, 130, 0.12), transparent 50%),
    linear-gradient(180deg, #0b1016 0%, #05070a 45%, #080b10 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 14s ease-in-out infinite;
}

.orb-a {
  width: 280px;
  height: 280px;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(201, 162, 39, 0.35);
}

.orb-b {
  width: 220px;
  height: 220px;
  bottom: 12%;
  right: -40px;
  background: rgba(40, 70, 100, 0.4);
  animation-delay: -4s;
}

.orb-c {
  width: 180px;
  height: 180px;
  bottom: 30%;
  left: -50px;
  background: rgba(201, 162, 39, 0.12);
  animation-delay: -8s;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.app {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: auto;
  padding: 18px 16px 40px;
}

.reveal {
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.top.reveal {
  animation-delay: 0.05s;
}

.hero.reveal {
  animation-delay: 0.12s;
}

.card.reveal:nth-of-type(1) {
  animation-delay: 0.18s;
}

.card.reveal:nth-of-type(2) {
  animation-delay: 0.26s;
}

.send-card.reveal {
  animation-delay: 0.34s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .orb {
    animation: none !important;
  }
}

/* Header */
.top {
  position: relative;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo {
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: clamp(52px, 12vw, 72px);
  letter-spacing: -0.08em;
  line-height: 0.9;
  background: linear-gradient(135deg, #fff8e7 0%, #e8c547 40%, #a8841a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(201, 162, 39, 0.25);
}

.logo span {
  background: linear-gradient(135deg, #ffe9a0, #c9a227 55%, #8a6b12);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-tag {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  padding-inline-start: 4px;
}

.lang {
  position: relative;
}

.lang button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s, background 0.2s;
}

.lang button:hover {
  border-color: var(--line-strong);
  background: var(--gold-soft);
}

.lang-globe::before {
  content: "◎";
  color: var(--gold-bright);
  font-size: 12px;
}

.chev::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-inline-end: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.8;
}

html[dir="ltr"] .chev::before {
  transform: rotate(45deg) translateY(-2px);
}

.langs {
  display: none;
  position: absolute;
  z-index: 200;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  background: rgba(14, 18, 24, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  width: 180px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.langs.open {
  display: block;
  pointer-events: auto;
  animation: menuIn 0.2s ease both;
}

@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.langs div {
  padding: 13px 15px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.15s;
}

.langs div:hover,
.langs div:focus {
  background: var(--gold-soft);
  color: var(--gold-bright);
}

/* Hero */
.hero {
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: clamp(24px, 5.5vw, 32px);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.sub {
  color: var(--muted);
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.7;
  font-weight: 300;
  max-width: 36em;
}

/* Cards */
.card {
  position: relative;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 40%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 197, 71, 0.55), transparent);
  opacity: 0.8;
}

label {
  display: block;
  font-weight: 600;
  margin: 16px 0 10px;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #d7dde4;
}

label:first-child {
  margin-top: 0;
}

input,
select,
textarea {
  width: 100%;
  background: rgba(5, 8, 12, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--text);
  padding: 14px 15px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--gold-soft);
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.6;
}

.fields {
  margin-top: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.brand,
.svc {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 0.18s ease, border-color 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
}

.brand {
  padding: 12px 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.svc {
  padding: 14px 10px;
  font-size: 13px;
  font-weight: 500;
}

.brand:hover,
.svc:hover {
  border-color: rgba(201, 162, 39, 0.35);
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.brand.sel,
.svc.sel {
  border-color: var(--gold);
  color: var(--gold-bright);
  background: linear-gradient(160deg, rgba(201, 162, 39, 0.18), rgba(201, 162, 39, 0.05));
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.25), inset 0 1px 0 rgba(255, 230, 150, 0.12);
}

.services {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.file-wrap {
  position: relative;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  border-radius: 14px;
  padding: 4px;
  background: rgba(201, 162, 39, 0.04);
}

.file-wrap input[type="file"] {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px;
}

.file-wrap input[type="file"]:focus {
  box-shadow: none;
}

.btn {
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: transform 0.18s ease, filter 0.18s, box-shadow 0.18s;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.gold {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f0d56a 0%, #c9a227 45%, #9a7615 100%);
  color: #1a1405;
  box-shadow: 0 10px 28px rgba(201, 162, 39, 0.28);
}

.gold::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 4.5s ease-in-out infinite;
}

@keyframes sheen {
  0%,
  60%,
  100% {
    transform: translateX(-120%);
  }
  75% {
    transform: translateX(120%);
  }
}

.green {
  background: linear-gradient(135deg, #2ecf78 0%, #1f9d55 50%, #0f6b38 100%);
  color: #fff;
  box-shadow: 0 12px 30px rgba(31, 157, 85, 0.28);
}

.send-card {
  padding: 14px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

.success {
  display: none;
  background: rgba(31, 157, 85, 0.12);
  border: 1px solid rgba(46, 207, 120, 0.35);
  color: #9aefbc;
  padding: 12px 14px;
  border-radius: 12px;
  margin-top: 12px;
  font-size: 14px;
}

.success.show {
  display: block;
  animation: rise 0.35s ease both;
}

.recent {
  display: none;
}

.recent.show {
  display: block;
  animation: rise 0.4s ease both;
}

.request {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 13px 14px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.footer {
  text-align: center;
  color: #6b737c;
  font-size: 12px;
  padding: 22px 8px 8px;
  letter-spacing: 0.04em;
}

/* Install */
.install-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(120deg, rgba(201, 162, 39, 0.16), rgba(201, 162, 39, 0.05));
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 13px 14px;
  margin: 12px 0 4px;
  backdrop-filter: blur(10px);
}

.install-banner.show {
  display: flex;
}

.install-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--text);
  flex: 1;
  line-height: 1.5;
}

.install-banner .install-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.install-banner button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
}

.install-banner .install-yes {
  background: linear-gradient(135deg, #e8c547, #c9a227);
  color: #1a1405;
}

.install-banner .install-no {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ios-hint {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.ios-hint.show {
  display: block;
}

.file-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

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

  .services {
    grid-template-columns: repeat(2, 1fr);
  }

  .row {
    grid-template-columns: 1fr;
  }

  .install-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .logo-tag {
    letter-spacing: 0.14em;
    font-size: 11px;
  }
}

@media (display-mode: standalone) {
  .install-banner {
    display: none !important;
  }

  body {
    padding-top: env(safe-area-inset-top);
  }
}
