/* =============================================
   FabricAI — Authentication Page Styles
   styles/auth.css
   ============================================= */

/* ─── Auth Page Wrapper ─────────────────────── */
#auth-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

/* ─── Floating decorative particles ────────── */
.auth-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-particle {
  position: absolute;
  border-radius: var(--radius-full);
  opacity: 0.15;
  animation: orbFloat1 var(--duration, 20s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.auth-particle:nth-child(1) {
  width: 300px; height: 300px;
  top: 5%; left: 10%;
  background: radial-gradient(circle, var(--color-brand-500), transparent 70%);
  --duration: 18s;
}

.auth-particle:nth-child(2) {
  width: 200px; height: 200px;
  top: 60%; right: 8%;
  background: radial-gradient(circle, var(--color-brand-700), transparent 70%);
  --duration: 22s; --delay: -7s;
}

.auth-particle:nth-child(3) {
  width: 150px; height: 150px;
  bottom: 10%; left: 30%;
  background: radial-gradient(circle, var(--color-brand-400), transparent 70%);
  --duration: 15s; --delay: -3s;
  animation-name: orbFloat2;
}

/* ─── Login Card ────────────────────────────── */
.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg-heavy);
  border: var(--glass-border);
  border-radius: var(--radius-2xl);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  padding: var(--space-10) var(--space-8);
  box-shadow: var(--shadow-xl), var(--shadow-brand);
  animation: scaleIn var(--duration-slow) var(--ease-bounce) both;
  overflow: hidden;
}

/* Animated gradient border at top */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-brand);
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

/* Subtle inner glow */
.auth-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, hsla(263,70%,60%,0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ─── Logo Area ─────────────────────────────── */
.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.auth-logo {
  width: 72px;
  height: 72px;
  animation: float 4s ease-in-out infinite;
}

.auth-brand-name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: var(--tracking-tight);
}

.auth-tagline {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  text-align: center;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
}

/* ─── Form ──────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-form-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: var(--space-2);
}

/* ─── Input Group ───────────────────────────── */
.input-group {
  position: relative;
}

.input-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2);
  transition: color var(--duration-fast) var(--ease-out);
}

.input-field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-field {
  width: 100%;
  height: 52px;
  padding: 0 var(--space-4);
  padding-right: 52px; /* Space for icon */
  background: hsla(240, 10%, 15%, 0.8);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--color-text-primary);
  transition: var(--transition-base);
  outline: none;
}

.input-field::placeholder {
  color: var(--color-text-tertiary);
}

.input-field:hover {
  border-color: var(--color-border-strong);
  background: hsla(240, 10%, 17%, 0.9);
}

.input-field:focus {
  border-color: var(--color-brand-500);
  background: hsla(240, 10%, 18%, 0.95);
  box-shadow: 0 0 0 3px hsla(263, 70%, 58%, 0.12);
}

.input-field.input--error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px var(--color-error-soft);
}

/* Show/Hide password toggle */
.input-toggle-btn {
  position: absolute;
  right: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease-out);
}

.input-toggle-btn:hover {
  color: var(--color-text-secondary);
}

.input-toggle-btn svg {
  width: 20px;
  height: 20px;
  pointer-events: none;
}

/* ─── Error Message ─────────────────────────── */
.auth-error {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-error-soft);
  border: 1px solid var(--color-error-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--color-error);
  animation: slideDown var(--duration-base) var(--ease-out);
  display: none;
}

.auth-error.visible {
  display: flex;
  animation: slideDown var(--duration-base) var(--ease-out), shake 0.5s var(--ease-out) 0.1s;
}

.auth-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ─── Login Button ──────────────────────────── */
.auth-btn {
  position: relative;
  width: 100%;
  height: 54px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  color: white;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  border: none;
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              opacity var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-brand);
}

.auth-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-shimmer);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-out);
}

.auth-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-brand-strong);
}

.auth-btn:hover::before {
  opacity: 1;
}

.auth-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Button loading state */
.auth-btn.loading {
  cursor: wait;
}

.auth-btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  position: relative;
  z-index: 1;
}

.auth-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid hsla(0,0%,100%,0.3);
  border-top-color: white;
  border-radius: var(--radius-full);
  animation: spin 0.7s linear infinite;
  display: none;
}

.auth-btn.loading .auth-btn-spinner {
  display: block;
}

.auth-btn.loading .auth-btn-text {
  opacity: 0.8;
}

/* Ripple effect */
.ripple {
  position: absolute;
  border-radius: var(--radius-full);
  background: hsla(0, 0%, 100%, 0.3);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

/* ─── Auth Footer ───────────────────────────── */
.auth-footer {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
}
