/* =====================================================
   ComFundMe — Shared Auth Page CSS
   Brand: Blue (#2563eb) | Dark navy bg
   ===================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --cfm-primary: #2563eb;
  --cfm-primary-light: #60a5fa;
  --cfm-primary-dark: #1e3a8a;
  --cfm-accent: #3b82f6;
  --cfm-border: rgba(255, 255, 255, 0.12);
  --cfm-surface: rgba(255, 255, 255, 0.05);
  --cfm-text-primary: #f1f5f9;
  --cfm-text-secondary: #94a3b8;
  --cfm-text-muted: #64748b;
  --cfm-danger: #f87171;
  --cfm-danger-bg: rgba(248, 113, 113, 0.1);
  --cfm-info: #60a5fa;
  --cfm-info-bg: rgba(96, 165, 250, 0.1);
  --cfm-success: #34d399;
  --cfm-warning: #fbbf24;
}

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060c1f;
  overflow-x: hidden;
  position: relative;
}

/* ── Background canvas ── */
.cfm-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 15%, rgba(37, 99, 235, 0.28) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(59, 130, 246, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(30, 58, 138, 0.18) 0%, transparent 70%),
    linear-gradient(135deg, #030818 0%, #060c1f 50%, #04081a 100%);
}

.cfm-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Floating orbs ── */
.cfm-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: cfmFloat 14s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.cfm-orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.55), transparent);
  top: -120px;
  left: -120px;
  animation-delay: 0s;
}

.cfm-orb-2 {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.45), transparent);
  bottom: -80px;
  right: -80px;
  animation-delay: -5s;
}

.cfm-orb-3 {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.35), transparent);
  top: 50%;
  right: 15%;
  animation-delay: -10s;
}

@keyframes cfmFloat {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(24px, -32px) scale(1.04);
  }

  66% {
    transform: translate(-16px, 22px) scale(0.97);
  }
}

/* ── Wrapper ── */
.cfm-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  animation: cfmFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cfmFadeUp {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Card ── */
.cfm-card {
  background: rgba(8, 16, 45, 0.72);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--cfm-border);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  box-shadow:
    0 0 0 1px rgba(37, 99, 235, 0.08),
    0 32px 64px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(37, 99, 235, 0.08);
}

/* ── Logo ── */
.cfm-logo {
  text-align: center;
  margin-bottom: 1.75rem;
}

.cfm-logo img {
  height: 42px;
  width: auto;
  opacity: 0.95;
}

/* ── Heading ── */
.cfm-heading {
  margin-bottom: 1.5rem;
}

.cfm-heading h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cfm-text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.cfm-heading p {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: var(--cfm-text-secondary);
}

/* ── Alerts ── */
.cfm-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.8125rem 1rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  animation: cfmSlideDown 0.3s ease both;
}

@keyframes cfmSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cfm-alert-danger {
  background: var(--cfm-danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: var(--cfm-danger);
}

.cfm-alert-info {
  background: var(--cfm-info-bg);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: var(--cfm-info);
}

.cfm-alert i {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Form ── */
.cfm-form-group {
  margin-bottom: 1rem;
}

.cfm-label {
  display: block;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--cfm-text-secondary);
  margin-bottom: 0.45rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cfm-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cfm-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--cfm-text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.2s;
  z-index: 2;
}

.cfm-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--cfm-border);
  border-radius: 12px;
  color: var(--cfm-text-primary);
  font-size: 0.9375rem;
  font-family: 'Inter', sans-serif;
  padding: 0.8125rem 1rem 0.8125rem 2.75rem;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.cfm-input::placeholder {
  color: var(--cfm-text-muted);
}

.cfm-input:focus {
  border-color: var(--cfm-primary);
  background: rgba(37, 99, 235, 0.07);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.cfm-input-wrap:focus-within .cfm-input-icon {
  color: var(--cfm-primary-light);
}

/* Input with right addon (toggle) */
.cfm-input.has-toggle {
  padding-right: 3rem;
}

.cfm-toggle-btn {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--cfm-text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  z-index: 2;
}

.cfm-toggle-btn:hover {
  color: var(--cfm-text-primary);
}

/* Error span */
.cfm-error {
  display: block;
  font-size: 0.75rem;
  color: var(--cfm-danger);
  margin-top: 0.375rem;
}

/* ── Password strength ── */
.cfm-strength-bar {
  height: 4px;
  border-radius: 4px;
  margin-top: 0.5rem;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.cfm-strength-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 0.35s ease, background 0.35s ease;
}

.cfm-strength-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cfm-text-muted);
  text-align: right;
  margin-top: 0.25rem;
  transition: color 0.3s;
}

/* ── Hint text ── */
.cfm-hint {
  font-size: 0.75rem;
  color: var(--cfm-text-muted);
  margin-top: 0.375rem;
  line-height: 1.5;
}

/* ── Links ── */
.cfm-link {
  color: var(--cfm-primary-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.cfm-link:hover {
  color: #93c5fd;
}

.cfm-forgot {
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  margin-top: 0.5rem;
}

/* ── Primary button ── */
.cfm-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--cfm-primary) 0%, var(--cfm-primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  padding: 0.875rem 1.5rem;
  cursor: pointer;
  margin-top: 1.375rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(37, 99, 235, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cfm-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.13), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.cfm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.52);
}

.cfm-btn:hover::before {
  opacity: 1;
}

.cfm-btn:active {
  transform: translateY(0);
}

.cfm-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ── Divider ── */
.cfm-divider {
  height: 1px;
  background: var(--cfm-border);
  margin: 1.5rem 0 1.25rem;
}

/* ── Trust badges ── */
.cfm-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cfm-border);
}

.cfm-trust-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--cfm-text-muted);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.cfm-trust-badge i {
  font-size: 0.875rem;
  color: var(--cfm-primary-light);
}

/* ── Footer ── */
.cfm-footer {
  text-align: center;
  margin-top: 1.375rem;
  font-size: 0.8125rem;
  color: var(--cfm-text-secondary);
}

/* ── Terms note ── */
.cfm-terms {
  text-align: center;
  font-size: 0.7125rem;
  color: var(--cfm-text-muted);
  margin-top: 1rem;
  line-height: 1.5;
}

/* ── Row layout ── */
.cfm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 480px) {
  .cfm-row {
    grid-template-columns: 1fr;
  }

  .cfm-wrapper {
    padding: 1rem;
  }

  .cfm-card {
    padding: 1.75rem 1.25rem;
  }
}

/* ── Spinner ── */
@keyframes cfmSpin {
  to {
    transform: rotate(360deg);
  }
}

.cfm-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cfmSpin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}