/* start.css (auth pages + start wizard)
   Updated: modern "pro" auth shell + safer defaults
   Fixes: correct z-index stacking so iframe background is visible,
          lighter overlay so constellation shows clearly,
          brighter/less-blurry iframe filter.
*/

:root{
  --brand:#2563eb;
  --brand-2:#06b6d4;
  --text:#0f172a;
  --muted:#64748b;
  --border:rgba(15,23,42,.14);
  --card-bg:rgba(255,255,255,.92);
  --shadow:0 18px 60px rgba(2,6,23,.35);
}

*{ box-sizing:border-box; }

body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  margin:0;
  padding:24px 16px;
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 10% 0%, rgba(37,99,235,.20), transparent 60%),
    radial-gradient(900px 700px at 100% 30%, rgba(6,182,212,.16), transparent 55%),
    linear-gradient(180deg, #0b1020 0%, #0b1224 40%, #0b1020 100%);
}

/* Legacy helpers (kept so older pages don’t break) */
.parent-container{
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-left:10px;
}

.error{ color:red; font-weight:bold; }
.success{ color:green; font-weight:bold; }

/* ------------------------------------------------------------------
   Full-page background (optional iframe) + overlay
   IMPORTANT: do NOT use negative z-index here; it can fall behind body.
   Layer order: bg (0) -> overlay (1) -> content (2+)
------------------------------------------------------------------ */
.background,
.auth-bg{
  position:fixed;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;
}

.background iframe,
.auth-bg iframe{
  width:100%;
  height:100%;
  border:0;
  transform:scale(1.02);
  /* Make the constellation page visible (less blur + brighter) */
  filter: blur(3px) saturate(1.15) brightness(.92) contrast(1.08);
  pointer-events:auto;
}

/* Overlay to "detach" from the old background look (lighter so bg shows) */
.auth-overlay{
  position:fixed;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:
    linear-gradient(120deg,
      rgba(2,6,23,.52) 0%,
      rgba(2,6,23,.18) 45%,
      rgba(2,6,23,.60) 100%
    ),
    radial-gradient(900px 650px at 20% 20%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(850px 650px at 80% 40%, rgba(6,182,212,.15), transparent 55%);
}

/* Constellation "stars" overlay (always-on, light touch) */
.auth-overlay::before{
  content:"";
  position:absolute;
  inset:-2px;
  pointer-events:none;
  opacity:.55;
  background-repeat:no-repeat;
  background-image:
    radial-gradient(2px 2px at 8% 22%, rgba(255,255,255,.40) 55%, transparent 60%),
    radial-gradient(1.5px 1.5px at 18% 70%, rgba(255,255,255,.28) 55%, transparent 60%),
    radial-gradient(2px 2px at 28% 35%, rgba(255,255,255,.35) 55%, transparent 60%),
    radial-gradient(1px 1px at 42% 18%, rgba(255,255,255,.22) 55%, transparent 60%),
    radial-gradient(1.5px 1.5px at 55% 78%, rgba(255,255,255,.26) 55%, transparent 60%),
    radial-gradient(2px 2px at 62% 40%, rgba(255,255,255,.36) 55%, transparent 60%),
    radial-gradient(1px 1px at 74% 22%, rgba(255,255,255,.22) 55%, transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 64%, rgba(255,255,255,.28) 55%, transparent 60%),
    radial-gradient(2px 2px at 92% 30%, rgba(255,255,255,.34) 55%, transparent 60%),
    radial-gradient(1px 1px at 90% 82%, rgba(255,255,255,.18) 55%, transparent 60%),
    radial-gradient(1px 1px at 12% 92%, rgba(255,255,255,.18) 55%, transparent 60%);
  mix-blend-mode: screen;
  animation: stars-drift 22s linear infinite;
}

@keyframes stars-drift{
  from { transform: translateY(0); }
  to   { transform: translateY(-40px); }
}

/* ------------------------------------------------------------------
   Content stacking
------------------------------------------------------------------ */
.auth-page{
  width:100%;
  min-height: calc(100vh - 48px);
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  z-index:2;
}

/* Legacy container (kept for compatibility) */
.container{
  display:block;
  width:600px;
  max-width:100%;
  height:auto;
  margin:0;
  background: #fff;
  padding:20px;
  border-radius:10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  position:relative;
  z-index:2;
}

/* --- New auth layout --- */
.auth-card{
  width:100%;
  max-width:420px;
  background:var(--card-bg);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  padding:28px;
  backdrop-filter: blur(10px);
}

.auth-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.auth-logo{
  width:44px;
  height:44px;
  border-radius:12px;
  box-shadow: 0 10px 24px rgba(2,6,23,.25);
  background: rgba(255,255,255,.6);
}

.auth-title{
  font-size:20px;
  font-weight:800;
  margin:0;
  line-height:1.1;
}

.auth-subtitle{
  margin:2px 0 0;
  font-size:13px;
  color:var(--muted);
}

.auth-divider{
  height:1px;
  background: rgba(15,23,42,.08);
  margin:14px 0 16px;
}

h2,h3{
  margin:0 0 10px;
  color:var(--text);
}

label{
  display:block;
  margin:0 0 6px;
  color:var(--muted);
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
}

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

.input-group{
  display:flex;
  align-items:stretch;
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
  background: rgba(255,255,255,.70);
}

.input-group:focus-within{
  border-color: rgba(37,99,235,.65);
  box-shadow: 0 0 0 4px rgba(37,99,235,.14);
}

.input-group-addon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  background: rgba(15,23,42,.04);
  border:0;
  border-right:1px solid rgba(15,23,42,.08);
  margin:0;
  padding:0;
}

.form-control{
  width:100%;
  padding:12px 12px;
  border:0;
  outline:0;
  margin:0;
  background:transparent;
  font-size:14px;
}

.help-block{
  display:block;
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
}

.help-block a{
  color:var(--muted);
  text-decoration:none;
}
.help-block a:hover{ color:var(--text); }

.alert{
  padding:10px 12px;
  border-radius:12px;
  font-size:14px;
  border:1px solid transparent;
  margin-bottom:12px;
}
.alert-danger{
  background: rgba(220,38,38,.10);
  border-color: rgba(220,38,38,.25);
  color:#991b1b;
}
.alert-success{
  background: rgba(16,185,129,.10);
  border-color: rgba(16,185,129,.22);
  color:#065f46;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  cursor:pointer;
  font-weight:700;
  user-select:none;
}

.btn:hover{ filter: brightness(1.03); }

.btn-primary{
  background: var(--brand);
  color:#fff;
}

.btn-secondary{
  background: rgba(15,23,42,.06);
  color: var(--text);
  border-color: rgba(15,23,42,.12);
}

.btn-icon{
  background: transparent;
  color: var(--muted);
  border-left:1px solid rgba(15,23,42,.10);
  border-radius:0;
  padding:0 14px;
}

.btn-icon:hover{
  background: rgba(15,23,42,.04);
  color: var(--text);
}

.w-100{ width:100%; }

.auth-actions{
  display:flex;
  justify-content:flex-end;
  margin: 6px 0 16px;
}

.site-footer{
  position:fixed;
  left:0;
  right:0;
  bottom:10px;
  text-align:center;
  font-size:12px;
  color: rgba(255,255,255,.70);
  pointer-events:none;
  z-index:3;
}

/* Tab navigation styles (legacy start page) */
.tab {
  overflow: hidden;
  border-bottom: 1px solid #ccc;
  margin-bottom: 20px;
}
.tab button {
  background-color: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 10px 20px;
  transition: background-color 0.3s;
  font-size: 16px;
  border-radius: 5px;
}
.tab button:hover { filter: brightness(110%); }
.tab button.active { background-color: #007bff; color: #fff; }
.tab-content {
  display: none;
  padding: 20px;
  border: 1px solid #ccc;
  border-top: none;
}
.tab-content.active { display: block; }

@media (max-width: 800px) {
  body{ padding:18px 14px; }
  .auth-card{ padding:22px; }
}

/* --- Wizard --- */
.auth-card--wide{
  max-width: 860px;
}

.auth-hint{
  margin: 0 0 16px 0;
  color: var(--muted);
}

/* card text color inside */
.auth-card code{
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(2,6,23,.06);
  border: 1px solid rgba(2,6,23,.10);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: .92em;
}

.wizard-steps{
  display:flex;
  gap:12px;
  margin: 14px 0 18px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.65);
}

.wizard-step-indicator{
  flex:1;
  display:flex;
  gap:12px;
  align-items:center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.08);
  background: rgba(255,255,255,.55);
}

.wizard-step-indicator.is-active{
  border-color: rgba(37,99,235,.35);
  box-shadow: 0 10px 30px rgba(37,99,235,.16);
  background: rgba(255,255,255,.78);
}

.wizard-step-indicator.is-done{
  border-color: rgba(6,182,212,.35);
  background: rgba(255,255,255,.78);
}

.wizard-dot{
  width:34px;
  height:34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:#fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(2,6,23,.20);
}

.wizard-meta{ line-height: 1.1; }
.wizard-label{ font-weight: 700; font-size: 14px; color: var(--text); }
.wizard-small{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.wizard-title{
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  display:flex;
  align-items:center;
  gap:10px;
}

.wizard-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

@media (max-width: 860px){
  .wizard-steps{ flex-direction: column; }
  .wizard-grid{ grid-template-columns: 1fr; }
}

.wizard-note{
  margin-top: 14px;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(2,6,23,.03);
  color: var(--muted);
  display:flex;
  gap:10px;
  align-items:flex-start;
}

.wizard-review{
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 14px;
  background: rgba(255,255,255,.60);
  overflow:hidden;
}

.wizard-review-row{
  display:flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15,23,42,.08);
}

.wizard-review-row:first-child{ border-top: 0; }

.wizard-review-k{
  color: var(--muted);
  font-weight: 700;
}

.wizard-review-v{
  color: var(--text);
  font-weight: 800;
  text-align:right;
  word-break: break-word;
}

.wizard-nav{
  margin-top: 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}
