/* Signup Page Styles */
.signup-page {
  min-height: 100vh;
  background: #0a0a0f;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(30, 64, 175, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.signup-container {
  width: 100%;
  max-width: 440px;
}

.signup-card {
  background: #1a1a24;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 48px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  position: relative;
  /* Single column: fields, captcha, and buttons share one width */
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* Home Button */
.home-button {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: all 0.2s ease;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.home-button:hover {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(148, 163, 184, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home-button svg {
  width: 18px;
  height: 18px;
}

/* Title and Subtitle */
.signup-title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 12px 0;
  text-align: center;
  letter-spacing: -0.02em;
}

.signup-subtitle {
  font-size: 0.95rem;
  color: rgba(148, 163, 184, 0.8);
  margin: 0 0 32px 0;
  text-align: center;
  line-height: 1.5;
}

.login-link {
  color: #3b82f6;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.login-link:hover {
  color: #2563eb;
}

/* Form Styles */
.signup-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  width: 100%;
}

.signup-terms {
  margin-bottom: 20px;
}

/* Terms inside step 1: spacing comes from .signup-step gap */
.signup-step .signup-terms {
  margin-bottom: 0;
}

.signup-terms-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.45;
  color: rgba(148, 163, 184, 0.95);
}

.signup-terms-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #3b82f6;
  cursor: pointer;
}

.signup-terms-text a {
  color: #93c5fd;
  text-decoration: underline;
}

.signup-terms-text a:hover {
  color: #bfdbfe;
}

/* Step-based registration flow */
.signup-step {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.signup-step-hidden {
  display: none !important;
}

/* reCAPTCHA v2 — full-width panel matches .form-input chrome; iframe stays ~304px centered */
.signup-recaptcha-wrap {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #151520;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  min-height: 0;
  overflow: hidden;
}

.signup-recaptcha-wrap > div {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  transform: none;
  margin: 0;
}

/* Dark theme + compact checkbox — avoid scaling past column (was wider than email field) */
.signup-recaptcha-wrap iframe {
  max-width: 100%;
}

/* Hybrid: v2 checkbox only after low v3 score */
.signup-recaptcha-v2-hidden {
  display: none !important;
}

.form-input-readonly {
  color: rgba(148, 163, 184, 0.8);
  cursor: default;
}

.btn-back {
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 8px 0;
  margin-top: -8px;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.btn-back:hover {
  color: rgba(148, 163, 184, 1);
}

/* Loader for send code button */
.btn-send-code {
  position: relative;
  min-height: 48px;
}

.btn-send-code .btn-text,
.btn-send-code .btn-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.signup-loader-hidden {
  display: none !important;
}

.loader-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: signup-spinner 0.8s linear infinite;
}

@keyframes signup-spinner {
  to { transform: rotate(360deg); }
}

.btn-send-code:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.btn-create-account {
  position: relative;
  min-height: 48px;
}

.btn-create-account .btn-text,
.btn-create-account .btn-loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-create-account:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

/* Code sent hint in step 2 */
.code-sent-hint {
  font-size: 0.9rem;
  color: rgba(74, 222, 128, 0.95);
  margin: 0 0 8px 0;
  padding: 12px 16px;
  background: rgba(74, 222, 128, 0.08);
  border-radius: 10px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  line-height: 1.5;
}

/* Resend code timer */
.resend-container {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(148, 163, 184, 0.8);
}

.resend-timer {
  display: inline-block;
}

.resend-link {
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.resend-link:hover:not(:disabled) {
  color: #2563eb;
}

.resend-link:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: #151520;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.form-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.form-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  background: #1a1a28;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Verification Code Group */
.verification-group {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.verification-input {
  flex: 1;
}

.btn-send {
  padding: 14px 24px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-send:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.btn-send:active {
  transform: translateY(0);
}

/* Sign Up Button */
.btn-signup {
  width: 100%;
  padding: 14px 24px;
  background: #151520;
  color: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0;
  box-sizing: border-box;
}

.btn-signup:hover {
  background: #1a1a28;
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.btn-signup:active {
  transform: translateY(0);
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 8px 0 20px;
  width: 100%;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: rgba(148, 163, 184, 0.2);
}

.divider-text {
  font-size: 0.85rem;
  color: rgba(148, 163, 184, 0.6);
  font-weight: 500;
}

/* Google Button */
.btn-google {
  width: 100%;
  padding: 14px 24px;
  background: #151520;
  color: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-google:hover {
  background: #1a1a28;
  border-color: rgba(148, 163, 184, 0.4);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Responsive */
@media (max-width: 640px) {
  .signup-card {
    padding: 40px 28px;
  }

  .signup-title {
    font-size: 1.75rem;
  }

  .signup-subtitle {
    font-size: 0.9rem;
  }

  .form-input {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  .btn-send {
    padding: 12px 20px;
    font-size: 0.9rem;
  }

  .verification-group {
    flex-direction: column;
  }

  .btn-send {
    width: 100%;
  }
}
