*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #07070f;
  --card:     #0f0f1e;
  --border:   #1a1a30;
  --accent:   #7c6fef;
  --accent2:  #a78bfa;
  --text:     #e2e2f0;
  --muted:    #5a5a7a;
  --error:    #f87171;
  --input-bg: #13132a;
  --radius:   14px;
}

html, body {
  height: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ── Animated background ──────────────────────────────────── */
.bg-orbs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.18;
  animation: drift 12s ease-in-out infinite alternate;
}
.orb-1 { width: 500px; height: 500px; background: #6d5cef; top: -150px; left: -100px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: #9b59d0; bottom: -100px; right: -80px; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: #4f46e5; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: -8s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(30px, 20px) scale(1.08); }
}
.orb-3 { animation-name: drift3; }
@keyframes drift3 {
  from { transform: translate(-50%, -50%) scale(1); }
  to   { transform: translate(calc(-50% + 20px), calc(-50% + 15px)) scale(1.06); }
}

.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(124,111,239,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(124,111,239,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Layout ───────────────────────────────────────────────── */
.container {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 100vh;
  padding: 24px;
  gap: 20px;
}

/* ── Card ─────────────────────────────────────────────────── */
.card {
  width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(124,111,239,0.08),
    0 24px 48px rgba(0,0,0,0.5),
    0 0 80px rgba(124,111,239,0.06);
  animation: fadeUp 0.5s ease;
}

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

/* ── Logo ─────────────────────────────────────────────────── */
.logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, rgba(124,111,239,0.2), rgba(167,139,250,0.1));
  border: 1px solid rgba(124,111,239,0.25);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text { display: flex; align-items: baseline; gap: 1px; }
.brand { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.brand-mail { font-size: 20px; font-weight: 300; color: var(--muted); letter-spacing: -0.5px; }

/* ── Headings ─────────────────────────────────────────────── */
.heading {
  font-size: 22px; font-weight: 600; letter-spacing: -0.5px;
  color: var(--text); margin-bottom: 4px;
}
.sub {
  font-size: 13px; color: var(--muted); margin-bottom: 28px;
}

/* ── Fields ───────────────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: 14px; margin-bottom: 6px; }

.field label {
  display: block;
  font-size: 12px; font-weight: 500; color: var(--muted);
  margin-bottom: 6px; letter-spacing: 0.3px; text-transform: uppercase;
}

.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-icon {
  position: absolute; left: 13px;
  color: var(--muted); pointer-events: none;
  flex-shrink: 0;
}
.input-wrap input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px 11px 38px;
  color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrap input::placeholder { color: var(--muted); }
.input-wrap input:focus {
  border-color: rgba(124,111,239,0.5);
  box-shadow: 0 0 0 3px rgba(124,111,239,0.1);
}

.pw-toggle {
  position: absolute; right: 10px;
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 4px;
  display: flex; align-items: center;
  transition: color 0.15s;
}
.pw-toggle:hover { color: var(--text); }

/* ── Error bar ────────────────────────────────────────────── */
.error-bar {
  display: none; align-items: center; gap: 7px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px; color: var(--error);
  margin-top: 14px;
}
.error-bar.show { display: flex; }

/* ── Sign in button ───────────────────────────────────────── */
.btn-signin {
  width: 100%; margin-top: 18px;
  padding: 12px;
  background: linear-gradient(135deg, #6d5cef, #9b59d0);
  border: none; border-radius: 10px;
  color: #fff; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(109,92,239,0.35);
  letter-spacing: 0.2px;
}
.btn-signin:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(109,92,239,0.45); }
.btn-signin:active { transform: translateY(0); }
.btn-signin:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-spinner.show { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ───────────────────────────────────────────────── */
.footer-info {
  display: flex; align-items: center; justify-content: center;
  gap: 5px;
  margin-top: 20px;
  font-size: 11.5px; color: var(--muted);
}

/* ── Trust badges ─────────────────────────────────────────── */
.trust-badges {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  animation: fadeUp 0.5s ease 0.1s both;
}
.badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 11.5px; color: var(--muted);
}

/* ── hCaptcha widget ──────────────────────────────────────── */
.captcha-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0 4px;
  min-height: 78px;
}
.captcha-wrap .h-captcha {
  transform-origin: center;
}
/* Make the hCaptcha iframe fit narrow cards on mobile by scaling it */
@media (max-width: 380px) {
  .captcha-wrap .h-captcha {
    transform: scale(0.86);
  }
}
/* Disabled sign-in button until captcha solved */
.btn-signin:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}
.btn-signin:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}
