:root {
  --primary: var(--pidon-accent,#FF3D9A);
  --dark: #0E0E18;
  --light: #f8fafc;
  --gray-light: #cbd5e1;
  --primary-color: #8B5CF6;
  --primary-hover: #7C3AED;
  --secondary-color: var(--pidon-accent,#FF3D9A);
  --accent-color: var(--pidon-accent,#FF3D9A);
  --darker-accent: var(--pidon-accent-dark,#B31F68);
  --success-color: #10b981;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bone: #e2e2e2;

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

  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(7, 7, 13, 0.15);
    /* Adjust opacity */
    z-index: -1;
    pointer-events: none;
    /* Allows interaction with page elements */
  }

  body {
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;

    /* Animated background: OFF (the image is kept in img/login-bg.svg). To bring it back, delete this comment mark and uncomment the 5 lines:
    background-image: url("img/login-bg.svg?v=2");
    background-attachment: fixed; background-size: cover; background-position: center; background-repeat: no-repeat; */
    background-color: #07070D;
  }

  .auth-container {
    background: rgba(14, 14, 24, 0.86);
    padding: 2.5rem 3rem;
    border-radius: 25px;
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.18), 0 0 80px rgba(255, 61, 154, 0.08);
    width: 100%;
    max-width: 400px;
  }

  .tabs {
    display: flex;
    margin-bottom: 2rem;
  }

  .tab {
    flex: 1;
    padding: 0.75rem 0;
    text-align: center;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-light);
    border-bottom: 3px solid transparent;
    transition: border-color 0.3s, color 0.3s;
    user-select: none;
  }

  .tab.active {
    border-color: var(--text-muted);
    color: var(--text-muted);
  }

  /* Login / Sign Up tab switch: white on hover (the inactive tab also gets a white underline) */
  .tab:hover {
    color: #ffffff;
  }

  .tab:not(.active):hover {
    border-color: #ffffff;
  }

  form {
    display: none;
    flex-direction: column;
    gap: 1rem;
  }

  form.active {
    display: flex;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  input[type="password"] {
    width: 100%;
    /* 🧠 This was missing */
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    border: var(--text-primary) 1px solid;
    font-family: "Inter", sans-serif;
    color: var(--text-muted);
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
  }

  input[type="text"]:focus,
  input[type="email"]:focus,
  input[type="password"]:focus {
    border-color: var(--accent-color);
    outline: none;
  }

  label {
    color: var(--text-muted);
    font-size: 0.99rem;
    font-weight: 600;
    font-family: inherit;
    margin-bottom: -15px;
  }

  .lucide {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    width: 1.3rem;
    height: 1.3rem;
    stroke: var(--text-secondary);
    stroke-width: 2;
  }

  button {
    padding: 0.85rem 1rem;
    background: var(--accent-color);
    color: var(--dark);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    font-family: "Inter", sans-serif;
    cursor: pointer;
    transition: background 0.3s;
  }

  button:hover {
    background: var(--darker-accent);
    color: var(--light);
  }

  .forgot-password {
    text-align: left;
    font-size: 0.9rem;
    margin-top: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
  }

  .forgot-password:hover {
    color: var(--accent-color);
  }
}

.error-input {
  border: 1px solid #f87171 !important;
  outline: none;
}

.error {
  font-size: 1rem;
  color: #f87171;
}

.message-box {
  margin: 15px 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  display: none;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-box.show {
  display: block;
}

.message-box.success {
  background-color: rgba(52, 211, 153, 0.1);
  border: 1px solid #34d399;
  color: #34d399;
}

.message-box.error {
  background-color: rgba(248, 113, 113, 0.1);
  border: 1px solid #f87171;
  color: #f87171;
}

.message-box.warning {
  background-color: rgba(255, 111, 181, 0.1);
  border: 1px solid #FF6FB5;
  color: #FF6FB5;
}

.message-box strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}

.error {
  color: #f87171;
  font-size: 13px;
  margin-top: 5px;
  min-height: 18px;
  display: none;
}

.error.show {
  display: block;
}

input.input-error {
  border-color: #f87171 !important;
}

.password-strength {
  margin-top: 8px;
  display: none;
}

.strength-bar {
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.strength-fill {
  height: 100%;
  width: 0%;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.strength-bar.strength-weak .strength-fill {
  width: 33%;
  background-color: #f87171;
}

.strength-bar.strength-medium .strength-fill {
  width: 66%;
  background-color: #FF6FB5;
}

.strength-bar.strength-strong .strength-fill {
  width: 100%;
  background-color: #34d399;
}

.strength-text {
  font-size: 13px;
  color: #9ca3af;
}

.password-requirements {
  margin-top: 12px;
  padding: 12px;
  background-color: rgba(255, 111, 181, 0.05);
  border: 1px solid rgba(255, 111, 181, 0.2);
  border-radius: 6px;
  font-size: 13px;
  display: none;
}

.password-requirements.show {
  display: block;
}

.password-requirements ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  color: #9ca3af;
}

.password-requirements li {
  margin: 4px 0;
  transition: color 0.2s;
}

.password-requirements li.valid {
  color: #34d399;
}

.password-requirements li.valid::marker {
  content: "✓ ";
}

button {
  position: relative;
  transition: all 0.3s ease;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button:disabled .spinner {
  display: inline-block;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #9ca3af;
  transition: color 0.2s;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #A78BFA;
}

.input-wrapper {
  position: relative;
}

.input-wrapper input {
  padding-left: 45px !important;
}

/* Arrow to the right of the Log In / Create Account label; replaced by the spinner while submitting */
.btn-arrow {
  margin-left: 8px;
  font-size: 0.85em;
  transition: transform 0.2s ease;
}

button:hover .btn-arrow {
  transform: translateX(3px);
}

button:has(.fa-spin:not([style*="display: none"])) .btn-arrow {
  display: none;
}

/* Cloudflare Turnstile slot: collapses to nothing while the widget is invisible */
.ts-slot {
  display: flex;
  justify-content: center;
  margin: 0.25rem 0;
}
.ts-slot:empty {
  display: none;
}
