/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-from:   #0f0c29;
  --bg-mid:    #302b63;
  --bg-to:     #24243e;
  --accent:    #a78bfa;
  --accent2:   #818cf8;
  --text:      #f1f5f9;
  --muted:     #94a3b8;
  --card-bg:   rgba(255, 255, 255, 0.07);
  --card-border: rgba(255, 255, 255, 0.12);
  --input-bg:  rgba(255, 255, 255, 0.06);
  --radius:    20px;
  --radius-sm: 12px;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0618; /* dark fallback while images load */
  font-family: 'Inter', sans-serif;
  color: var(--text);
  padding: 24px;
}

/* ── Background slideshow ─────────────────────────────────────────────────── */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

/* Cinematic dark overlay — keeps card text readable against any image */
.bg-slideshow::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(8, 6, 24, 0.58);
  z-index: 1;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  will-change: opacity, transform;
}

/* ── Card ─────────────────────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

/* ── Logo / badge ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(167, 139, 250, 0.15);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 28px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Typography ───────────────────────────────────────────────────────────── */
.headline {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.subline {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 36px;
}

/* ── Form ─────────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

input::placeholder { color: rgba(255,255,255,0.25); }

/* ── Code input (large centered digits) ──────────────────────────────────── */
.code-input {
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: 12px !important;
  text-align: center !important;
}

/* ── Button ───────────────────────────────────────────────────────────────── */
.btn {
  width: 100%;
  padding: 15px;
  margin-top: 8px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4);
}

.btn:hover  { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(124,58,237,0.5); }
.btn:active { transform: translateY(0);    opacity: 0.92; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid;
}

.flash.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* ── Divider ──────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 28px 0;
}

/* ── Footer note ──────────────────────────────────────────────────────────── */
.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 24px;
}

.footnote a { color: var(--accent); text-decoration: none; }
.footnote a:hover { text-decoration: underline; }

/* ── Success icon ─────────────────────────────────────────────────────────── */
.success-icon {
  width: 72px; height: 72px;
  background: rgba(167, 139, 250, 0.15);
  border: 2px solid rgba(167, 139, 250, 0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 28px;
  font-size: 32px;
  animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1);   }
}

.text-center { text-align: center; }

/* ── Home / Dashboard page ───────────────────────────────────────────────── */
body.home-body {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
}

.home-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10, 6, 24, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.home-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.home-user-email {
  font-size: 13px;
  color: var(--muted);
}

.home-logout-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 6px 18px;
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 999px;
  transition: background 0.2s;
}

.home-logout-btn:hover {
  background: rgba(167, 139, 250, 0.12);
}

.home-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 108px 32px 64px;
  width: 100%;
}

/* Hero */
.home-hero {
  text-align: center;
  margin-bottom: 60px;
  animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.home-platform-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.home-headline {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.home-subline {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.7;
}

/* Tools grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.tool-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.tool-card-link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.tool-card-link:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
  border-color: rgba(167, 139, 250, 0.4);
}

.tool-card-soon {
  opacity: 0.45;
  pointer-events: none;
}

.tool-cat {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  width: fit-content;
}

.tool-cat-structural {
  background: rgba(29, 158, 117, 0.15);
  border: 1px solid rgba(29, 158, 117, 0.3);
  color: #1D9E75;
}

.tool-cat-coming {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--muted);
}

.tool-name {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.3;
}

.tool-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
}

.tool-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--card-border);
}

.chip-available {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1D9E75;
}

.chip-dot {
  width: 7px; height: 7px;
  background: #1D9E75;
  border-radius: 50%;
  box-shadow: 0 0 6px #1D9E75;
  animation: pulse 2s infinite;
}

.chip-coming {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tool-open-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ── Home footer ─────────────────────────────────────────────────────────── */
.home-footer {
  width: 100%;
  background: rgba(15, 12, 41, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative; z-index: 1;
}
.home-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 1.1rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .8rem;
}
.home-footer-logo {
  font-weight: 800; font-size: .95rem; color: #f1f5f9; letter-spacing: -.02em;
}
.home-footer-logo span { color: #a78bfa; }
.home-footer-copy { font-size: .78rem; color: #94a3b8; }
.home-footer-contact {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(167,139,250,.1); border: 1px solid rgba(167,139,250,.25);
  color: #a78bfa; text-decoration: none; padding: .38rem 1rem;
  border-radius: 20px; font-size: .82rem; font-weight: 700;
  transition: background .2s;
}
.home-footer-contact:hover { background: rgba(167,139,250,.2); color: #c4b5fd; }

/* ── Mobile — auth card ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 32px 20px; }
}

/* ── Mobile — home ───────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .home-header-inner { padding: 12px 16px; }
  .home-content      { padding: 84px 16px 32px; }
  .home-user-email   { display: none; }
  .tools-grid        { grid-template-columns: 1fr; }
  .home-footer-inner { padding: .9rem 1rem; }
  .home-footer-copy  { display: none; }
  .home-headline     { font-size: 1.6rem; }
  .home-subline      { font-size: .9rem; }
}
