/* ==========================================================================
   GameBox Cloud account pages — signup / login / forgot / account
   Matches the pixel-arcade theme in styles.css (dark, orange glow).
   ========================================================================== */

/* ---------------- Auth page shell ---------------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--nav-h) + 48px) 24px 64px;
  position: relative; overflow: hidden;
}
.auth-card {
  width: 100%; max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  position: relative; z-index: 1;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5), 0 0 48px rgba(255, 122, 26, 0.08);
}
.auth-card.wide { max-width: 560px; }
.auth-card h1 {
  font-size: clamp(1rem, 3vw, 1.3rem);
  margin: 14px 0 8px;
  background: linear-gradient(100deg, #ffffff 25%, #ffd9a8 60%, #ff7a1a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.auth-card .lede { margin: 0 0 28px; font-size: 0.98rem; }

/* ---------------- Forms ---------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: var(--text-dim); margin-bottom: 8px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="color"],
.field select {
  width: 100%;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.95rem; font-family: var(--font);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input::placeholder { color: var(--muted); }
.field input:focus, .field select:focus {
  border-color: rgba(255, 122, 26, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.18);
}
.field input[type="color"] {
  padding: 6px 10px; height: 52px; cursor: pointer;
}
.field .hint { font-size: 0.82rem; color: var(--muted); margin-top: 6px; }

.form-error, .form-success {
  display: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 0.9rem; font-weight: 500;
  margin-bottom: 18px;
}
.form-error { background: rgba(253, 164, 175, 0.1); border: 1px solid rgba(253, 164, 175, 0.35); color: #fda4af; }
.form-success { background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.3); color: #4ade80; }
.form-error.show, .form-success.show { display: block; }

.auth-alt { margin-top: 22px; text-align: center; font-size: 0.92rem; color: var(--muted); }
.auth-alt a { color: #ffd9a8; font-weight: 600; }

.btn[disabled] { opacity: 0.6; cursor: wait; }
.btn .spinner {
  display: inline-block; width: 14px; height: 14px; margin-right: 10px;
  border: 2px solid rgba(26, 14, 0, 0.35); border-top-color: #1a0e00;
  border-radius: 50%; animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
.btn-ghost .spinner { border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- Account page ---------------- */
.account-wrap {
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--nav-h) + 48px) 24px 96px;
}
.account-head { margin-bottom: 32px; }
.account-head h1 {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  background: linear-gradient(100deg, #ffffff 25%, #ffd9a8 60%, #ff7a1a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  margin: 12px 0 6px;
}
.account-head p { color: var(--muted); }

.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.acct-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px 28px;
}
.acct-card.full { grid-column: 1 / -1; }
.acct-card h2 { font-size: 0.85rem; margin-bottom: 4px; }
.acct-card > p.desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }

.kv { display: grid; gap: 10px; margin-bottom: 18px; }
.kv-row { display: flex; justify-content: space-between; gap: 16px; font-size: 0.94rem; }
.kv-row .k { color: var(--muted); }
.kv-row .v { font-weight: 600; text-align: right; }
.pill {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  background: rgba(74, 222, 128, 0.12); color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.pill.free { background: rgba(255,255,255,0.06); color: var(--text-dim); border-color: var(--line); }
.pill.warn { background: rgba(255, 183, 77, 0.12); color: #ffb74d; border-color: rgba(255, 183, 77, 0.35); }
.pill.founding { background: rgba(255, 122, 26, 0.14); color: #ffb74d; border-color: rgba(255, 122, 26, 0.45); }

/* Plan picker */
.plan-options { display: grid; gap: 12px; margin-bottom: 20px; }
.plan-option {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.plan-option:hover { border-color: rgba(255, 122, 26, 0.4); }
.plan-option.selected {
  border-color: rgba(255, 122, 26, 0.7);
  background: rgba(255, 122, 26, 0.06);
  box-shadow: 0 0 24px rgba(255, 122, 26, 0.12);
}
.plan-option input { accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 auto; }
.plan-option .plan-info { flex: 1; }
.plan-option .plan-name { font-weight: 700; }
.plan-option .plan-tag { font-size: 0.82rem; color: #ffb74d; margin-top: 2px; }
.plan-option .plan-price { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.plan-option .plan-price small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 500; }

/* Square card element container */
#card-container {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 4px; background: rgba(255,255,255,0.03);
  margin-bottom: 18px; min-height: 56px;
}
#card-container.Sq-focus { border-color: rgba(255, 122, 26, 0.7); box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.18); }
#card-container.Sq-error { border-color: rgba(253, 164, 175, 0.6); }
.card-errors { color: #fda4af; font-size: 0.88rem; margin: -8px 0 14px; min-height: 1.2em; }
.secure-note { font-size: 0.82rem; color: var(--muted); margin-top: 12px; }

/* Avatar picker */
.avatar-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.avatar-choice {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; cursor: pointer;
  border: 2px solid var(--line); background: rgba(255,255,255,0.03);
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.avatar-choice:hover { transform: translateY(-2px); }
.avatar-choice.selected { border-color: var(--accent); box-shadow: 0 0 16px rgba(255, 122, 26, 0.35); }
.avatar-preview {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; margin-bottom: 14px;
  border: 1px solid var(--line);
}

.theme-row { display: flex; gap: 10px; flex-wrap: wrap; }
.theme-choice {
  flex: 1 1 0; min-width: 100px;
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; text-align: center; cursor: pointer;
  font-size: 0.88rem; font-weight: 600; color: var(--muted);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.theme-choice.selected { border-color: var(--accent); color: var(--text); background: rgba(255,122,26,0.07); }

/* Danger zone */
.danger-zone { border: 1px solid rgba(253, 164, 175, 0.35); border-radius: var(--radius-lg); padding: 28px; background: rgba(253, 164, 175, 0.04); }
.danger-zone h2 { color: #fda4af; }
.btn-danger {
  background: transparent; color: #fda4af;
  border: 1px solid rgba(253, 164, 175, 0.5);
  box-shadow: none;
}
.btn-danger:hover { background: rgba(253, 164, 175, 0.1); border-color: #fda4af; }
.step-up { display: none; margin-top: 18px; }
.step-up.show { display: block; }

/* Cloud pitch on signup */
.cloud-pitch {
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--line);
}
.cloud-pitch h3 { font-size: 0.95rem; margin-bottom: 12px; }
.cloud-pitch ul { list-style: none; display: grid; gap: 10px; font-size: 0.9rem; color: var(--text-dim); }
.cloud-pitch li { padding-left: 26px; position: relative; }
.cloud-pitch li::before {
  content: ""; position: absolute; left: 0; top: 7px;
  width: 12px; height: 7px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}
.cloud-pitch .founding-note { color: #ffb74d; font-weight: 600; }
.cloud-pitch .launch-note { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 12px; }

/* Success panel (forgot page) */
.success-panel { text-align: center; padding: 16px 0; }
.success-panel .big-emoji { font-size: 3rem; margin-bottom: 12px; }

/* ---------------- Dashboard banner ---------------- */
.dash-banner {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 26px;
  margin-bottom: 20px;
  box-shadow: 0 0 32px rgba(255, 122, 26, 0.07);
}
.dash-banner[hidden] { display: none; }
.dash-avatar {
  width: 60px; height: 60px; border-radius: 16px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.9rem; border: 1px solid var(--line);
}
.dash-info { flex: 1; min-width: 0; }
.dash-hello { font-weight: 700; font-size: 1.05rem; margin: 0 0 2px; }
.dash-meta { color: var(--muted); font-size: 0.88rem; margin: 0 0 8px; }
.dash-dl { text-decoration: none; display: inline-block; }
.dash-banner .pill { flex: 0 0 auto; }

/* ---------------- Section nav pills ---------------- */
.nav-pills {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 24px;
  position: sticky; top: calc(var(--nav-h) + 8px); z-index: 5;
}
.nav-pills a {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(20, 12, 4, 0.85);
  color: var(--text-dim); font-size: 0.86rem; font-weight: 600;
  text-decoration: none; backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.nav-pills a:hover { border-color: rgba(255, 122, 26, 0.5); color: var(--text); }
.nav-pills a.active {
  border-color: rgba(255, 122, 26, 0.7); color: #ffd9a8;
  background: rgba(255, 122, 26, 0.12);
  box-shadow: 0 0 16px rgba(255, 122, 26, 0.15);
}

/* ---------------- Cloud launch banner ---------------- */
#cloudLaunch[hidden] { display: none; }
.launch-banner {
  display: flex; align-items: center; gap: 18px;
  border: 1px solid rgba(255, 122, 26, 0.45); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px;
  background:
    radial-gradient(ellipse 80% 120% at 85% 20%, rgba(147, 51, 234, 0.14), transparent),
    radial-gradient(ellipse 70% 100% at 10% 90%, rgba(255, 122, 26, 0.12), transparent),
    rgba(20, 10, 4, 0.6);
  box-shadow: 0 0 32px rgba(255, 122, 26, 0.12);
}
.launch-emoji { font-size: 2.6rem; flex: 0 0 auto; filter: drop-shadow(0 0 12px rgba(255, 122, 26, 0.5)); }
.launch-title {
  font-weight: 800; font-size: 1.05rem; margin: 0 0 4px;
  background: linear-gradient(100deg, #ffffff 20%, #ffd9a8 60%, #ff7a1a 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.launch-sub { color: var(--text-dim); font-size: 0.9rem; margin: 0; }

/* Preview plan cards (display-only until launch) */
.preview-plans { display: grid; gap: 12px; }
.preview-plan {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; background: rgba(255, 255, 255, 0.02);
}
.preview-plan .plan-info { flex: 1; }
.preview-plan .plan-name { font-weight: 700; }
.preview-plan .plan-tag { font-size: 0.82rem; color: #ffb74d; margin-top: 2px; }
.preview-plan .plan-price { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.preview-plan .plan-price small { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
.preview-plan.founding {
  border-color: rgba(255, 122, 26, 0.45);
  background: rgba(255, 122, 26, 0.05);
  box-shadow: 0 0 20px rgba(255, 122, 26, 0.1);
}
.plan-live-tag {
  flex: 0 0 auto; font-size: 0.75rem; font-weight: 700;
  color: #ffd9a8; border: 1px dashed rgba(255, 122, 26, 0.5);
  border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}

/* ---------------- Devices ---------------- */
.device-list { display: grid; gap: 12px; }
.device-row {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; background: rgba(255, 255, 255, 0.02);
}
.device-row.revoked { opacity: 0.55; }
.device-info { flex: 1; min-width: 0; }
.device-name { font-weight: 700; margin-right: 8px; }
.device-meta { display: block; font-size: 0.84rem; color: var(--muted); margin-top: 3px; }
.device-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.device-actions .desc { margin: 0; font-size: 0.85rem; }
.code-input {
  width: 130px; padding: 10px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font-size: 0.95rem; font-family: var(--font); outline: none;
  text-align: center; letter-spacing: 2px;
}
.code-input:focus {
  border-color: rgba(255, 122, 26, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.18);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .acct-grid { grid-template-columns: 1fr; }
}
/* Checkout: billing country + postal side by side, Turnstile spacing */
.field-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 12px; }
#turnstileWidget { margin: 4px 0 2px; min-height: 65px; }
@media (max-width: 560px) {
  .auth-card { padding: 36px 26px; }
  .acct-card { padding: 26px 20px; }
  .plan-option { padding: 14px; }
  .dash-banner { flex-wrap: wrap; }
  .launch-banner { flex-direction: column; text-align: center; }
  .device-row { flex-direction: column; align-items: flex-start; }
  .preview-plan { flex-wrap: wrap; }
}
