/* ============================================
   GrowBeat VPN — Auth Page Styles
   ============================================ */

.auth-body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 1.5rem;
}

.auth-container {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

/* --- Logo --- */
.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.auth-logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-logo-icon svg {
  width: 24px;
  height: 24px;
  color: white;
}

.auth-logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.auth-logo-text span {
  color: var(--accent);
}

/* --- Card --- */
.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--whisper-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--diffused-shadow);
}

/* --- Tabs --- */
.auth-tabs {
  display: flex;
  background: var(--canvas);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  margin-bottom: 1.75rem;
}

.auth-tab {
  flex: 1;
  padding: 0.625rem 1rem;
  border-radius: calc(var(--radius-sm) - 0.125rem);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--secondary);
  transition: all var(--duration-fast) var(--ease-out);
  text-align: center;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.auth-tab:hover:not(.active) {
  color: var(--ink);
}

/* --- Forms --- */
.auth-form {
  display: none;
  animation: sectionFadeIn var(--duration-normal) var(--ease-out);
}

.auth-form.active {
  display: block;
}

.auth-step {
  display: none;
  animation: sectionFadeIn var(--duration-normal) var(--ease-out);
}

.auth-step.active {
  display: block;
}

.auth-step-info {
  font-size: 0.875rem;
  color: var(--secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.auth-step-info strong {
  color: var(--ink);
}

/* --- Fields --- */
.auth-field {
  margin-bottom: 0.75rem;
}

.auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.375rem;
}

.auth-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--whisper-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.auth-input::placeholder {
  color: var(--muted);
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-input.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-light);
}

/* --- Code Inputs --- */
.auth-code-inputs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.auth-code-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--whisper-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.auth-code-digit:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* --- Password Strength --- */
.auth-password-strength {
  height: 3px;
  border-radius: 2px;
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: opacity var(--duration-fast);
}

.auth-password-strength::after {
  content: '';
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: width var(--duration-normal) var(--ease-out), background var(--duration-normal);
}

.auth-password-strength.weak::after {
  width: 25%;
  background: var(--danger);
}

.auth-password-strength.fair::after {
  width: 50%;
  background: var(--warning);
}

.auth-password-strength.good::after {
  width: 75%;
  background: #3B82F6;
}

.auth-password-strength.strong::after {
  width: 100%;
  background: var(--accent);
}

/* --- Password Rules --- */
.auth-password-rules {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.auth-rule {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color var(--duration-fast);
}

.auth-rule.pass {
  color: var(--accent);
}

.auth-rule-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-spring);
  position: relative;
}

.auth-rule.pass .auth-rule-icon {
  background: var(--accent);
  border-color: var(--accent);
}

.auth-rule.pass .auth-rule-icon::after {
  content: '';
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) translate(-0.5px, -0.5px);
}

/* --- Error --- */
.auth-error {
  font-size: 0.8125rem;
  color: var(--danger);
  margin-bottom: 0.75rem;
  min-height: 1.25em;
  line-height: 1.5;
  transition: opacity var(--duration-fast);
}

/* --- Submit Button --- */
.auth-submit {
  margin-top: 0.5rem;
  position: relative;
}

.auth-submit.loading .auth-submit-text {
  opacity: 0;
}

.auth-submit.loading .auth-submit-loader {
  opacity: 1;
}

.auth-submit-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

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

.auth-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Forgot Link --- */
.auth-link {
  display: block;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--secondary);
  margin-top: 1rem;
  transition: color var(--duration-fast);
}

.auth-link:hover {
  color: var(--accent);
}

/* --- Forgot Block --- */
.auth-forgot-block {
  display: none;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--whisper-border);
  animation: sectionFadeIn var(--duration-normal) var(--ease-out);
}

.auth-forgot-block.visible {
  display: block;
}

/* --- Support --- */
.auth-support {
  font-size: 0.8125rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.auth-support a {
  color: var(--secondary);
  font-weight: 500;
}

.auth-support a:hover {
  color: var(--accent);
}

.auth-support-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(249, 250, 251, 0.9);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--whisper-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  font-size: 0.9375rem;
  color: var(--secondary);
  font-weight: 500;
}

/* --- Responsive --- */
@media (max-width: 480px) {
  .auth-body {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }

  .auth-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .auth-code-digit {
    width: 42px;
    height: 48px;
    font-size: 1.125rem;
  }

  .auth-code-inputs {
    gap: 0.375rem;
  }
}

/* --- Divider --- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--whisper-border);
}

/* --- Google Sign-In Button (Google Brand Guidelines) --- */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.6875rem 1rem;
  border: 1px solid #DADCE0;
  border-radius: 4px;
  background: #FFFFFF;
  font-family: 'Roboto', var(--font-display), sans-serif;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #3C4043;
  cursor: pointer;
  transition: background var(--duration-fast), box-shadow var(--duration-fast);
  letter-spacing: 0.0089em;
  position: relative;
}

.btn-google:hover {
  background: #F8FAFE;
  border-color: #D2E3FC;
  box-shadow: 0 1px 3px rgba(66, 133, 244, 0.15);
}

.btn-google:active {
  background: #ECF3FE;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

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

.btn-google[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
