/* ─── VARIABLES ──────────────────────────────────────── */
:root {
  --accent: #2563eb;
  --card:   #ffffff;
  --sub:    #64748b;
  --border: #e2e8f0;
}

*, *::before, *::after {
  box-sizing: border-box;
  font-family: Inter, system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

/* ─── PAGE — WHITE BACKGROUND ────────────────────────── */
html, body {
  min-height: 100%;
}

html {
  background: #f0f4ff;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center; /* Centered vertically for better mobile view */
  padding: 20px;
  background: transparent;
  position: relative;
  overflow-x: hidden;
}

/* ─── BACKGROUND TECH ICONS ──────────────────────────── */
.bg-icons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-icon {
  position: absolute;
  left: var(--x);
  top:  var(--y);
  width: var(--sz);
  height: var(--sz);
  transform: rotate(var(--rot));
  animation: bgFloat 7s ease-in-out infinite;
  animation-delay: var(--del);
}

.bg-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.12;
  filter: grayscale(30%) hue-rotate(200deg);
  transition: opacity 0.3s;
}

@keyframes bgFloat {
  0%   { transform: rotate(var(--rot)) translateY(0px);   }
  50%  { transform: rotate(var(--rot)) translateY(-14px); }
  100% { transform: rotate(var(--rot)) translateY(0px);   }
}

/* ─── CARD ────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  padding: 36px 32px;
  border-radius: 20px;
  box-shadow:
    0 2px 4px rgba(0,0,0,.04),
    0 8px 24px rgba(37,99,235,.10),
    0 32px 64px rgba(0,0,0,.08);
  border: 1px solid rgba(37,99,235,.10);
  animation: cardIn .55s cubic-bezier(.22,1,.36,1);
  position: relative;
  z-index: 1;
  margin: auto 0;
}

.container::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(37,99,235,.045) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: 20px;
  pointer-events: none;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(28px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

/* ─── LOGO ────────────────────────────────────────────── */
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 42px;
}

.logo-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}

/* ─── HEADER TEXT ─────────────────────────────────────── */
.tag, .trust {
  text-align: center;
  font-size: 13px;
  margin-top: 12px;
}

.tag { color: var(--sub); }
.trust { color: #16a34a; font-weight: 600; }

/* ─── SECTIONS ────────────────────────────────────────── */
.section {
  margin-top: 22px;
}

label {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
}

select, input {
  width: 100%;
  margin-top: 8px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 14px;
  color: #1e293b;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ─── HELPER & CHIPS ──────────────────────────────────── */
.helper {
  font-size: 12px;
  color: var(--sub);
  margin-top: 4px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  transition: all .22s;
  user-select: none;
  opacity: 0;
  transform: translateY(8px) scale(.95);
}

.chip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #eff6ff;
  transform: translateY(-2px);
}

.chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(37,99,235,.32);
  transform: translateY(-2px) scale(1.03);
}

/* ─── REVIEW BOX ──────────────────────────────────────── */
#reviewBox {
  margin-top: 20px;
  padding: 18px;
  background: #f8faff;
  border-radius: 12px;
  border: 1.5px solid #dbeafe;
  display: none;
  line-height: 1.78;
  font-size: 14px;
  color: #1e293b;
  animation: fadeUp .4s ease;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ─── BUTTON & NOTE ───────────────────────────────────── */
button {
  margin-top: 20px;
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: all .22s;
  box-shadow: 0 8px 24px rgba(37,99,235,.30);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(37,99,235,.42);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

.note {
  text-align: center;
  font-size: 12px;
  color: #94a3b8;
  margin-top: 10px;
}

/* ─── RESPONSIVE MOBILE TWEAKS ────────────────────────── */
@media (max-width: 640px) {
  body {
    padding: 16px;
    align-items: flex-start; /* Move to top so keyboard doesn't hide form */
  }

  .container {
    padding: 24px 20px;
    border-radius: 16px;
  }

  /* Dynamically scale down ALL background icons so they don't clutter the screen */
  .bg-icon {
    width: calc(var(--sz) * 0.6);
    height: calc(var(--sz) * 0.6);
  }

  /* Hide center icons that get blocked by the card anyway */
  .bg-icon:nth-child(n+7) {
    display: none;
  }

  .logo-text { font-size: 22px; }
  .tag, .trust { font-size: 12px; }
  select, input { font-size: 13px; padding: 12px; }
  button { padding: 15px; font-size: 14px; }
  
  .chip {
    font-size: 12px;
    padding: 8px 14px;
  }
}

/* Extra small screens (e.g. iPhone SE) */
@media (max-width: 380px) {
  .container { padding: 20px 16px; }
  
  /* Scale icons down even more for tiny screens */
  .bg-icon {
    width: calc(var(--sz) * 0.45);
    height: calc(var(--sz) * 0.45);
  }
}