/* ========================================
   SOCAF POS - Authentication Pages
   Login, Register, Password Reset
   ======================================== */

/* ========================================
   AUTH PAGE LAYOUT
   ======================================== */

.auth-page {
  min-height: 100vh;
  position: relative;
  background:
    linear-gradient(135deg, rgba(248, 250, 252, 0.97) 0%, rgba(241, 245, 249, 0.95) 100%),
    url("https://images.unsplash.com/photo-1556742502-ec7c0e9f34b1?auto=format&fit=crop&w=1600&q=80");
  background-position: center;
  background-size: cover;
  overflow-x: hidden;
}

/* Animated gradient orbs */
.auth-page::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -15%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(59, 130, 246, 0.12) 0%, transparent 60%);
  pointer-events: none;
  animation: floatSlow 12s ease-in-out infinite;
}

.auth-page::after {
  content: "";
  position: absolute;
  bottom: -20%;
  left: -10%;
  width: 50%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(244, 63, 94, 0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: floatSlow 15s ease-in-out infinite reverse;
}

/* Decorative grid pattern */
.auth-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(30, 64, 175, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 64, 175, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}

.auth-main {
  display: grid;
  min-height: calc(100vh - 80px);
  align-items: center;
  padding: 80px 0;
  position: relative;
  z-index: 1;
}

/* ========================================
   AUTH GRID LAYOUT
   ======================================== */

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 64px;
  align-items: center;
}

/* ========================================
   AUTH COPY / MARKETING SIDE
   ======================================== */

.auth-copy {
  max-width: 520px;
  animation: slideInLeft 0.8s var(--ease-out) backwards;
  animation-delay: 0.15s;
}

.auth-copy h1 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--color-ink) 0%, var(--color-ink-2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-copy p {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--color-muted);
}

/* Feature list in auth copy */
.auth-features {
  display: grid;
  gap: 16px;
  margin-top: 32px;
  list-style: none;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--color-ink-2);
  font-weight: 500;
}

.auth-features li::before {
  content: "";
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success-light) 100%);
  box-shadow: 0 2px 8px var(--color-success-glow);
}

/* ========================================
   AUTH PANEL / FORM CARD
   ======================================== */

.auth-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  padding: 48px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.4);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 
    var(--shadow-2xl),
    0 0 80px rgba(59, 130, 246, 0.06);
  animation: slideInRight 0.8s var(--ease-out) backwards;
  animation-delay: 0.25s;
  overflow: hidden;
}

/* Top gradient accent bar */
.auth-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    var(--color-primary) 0%, 
    var(--color-accent) 50%, 
    var(--color-success) 100%);
}

/* Subtle corner decoration */
.auth-panel::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ========================================
   AUTH PANEL HEADER
   ======================================== */

.auth-panel__header {
  margin-bottom: 36px;
  text-align: center;
}

.auth-panel__header h2 {
  margin-bottom: 12px;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-ink);
}

.auth-panel__header p {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* ========================================
   AUTH FORM ENHANCEMENTS
   ======================================== */

.auth-panel .form {
  gap: 24px;
}

.auth-panel .field {
  gap: 10px;
}

.auth-panel .field label {
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-panel .field input {
  min-height: 56px;
  padding: 16px 20px;
  font-size: 1rem;
  border-radius: var(--radius);
  border: 2px solid var(--color-soft-2);
  background: var(--color-white);
  transition: all var(--transition-fast);
}

.auth-panel .field input:hover {
  border-color: var(--color-line);
}

.auth-panel .field input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 4px var(--color-primary-50), var(--shadow-sm);
}

.auth-panel .button {
  min-height: 56px;
  font-size: 1rem;
  font-weight: 700;
}

/* ========================================
   AUTH SWITCH / LINKS
   ======================================== */

.auth-switch {
  margin: 32px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--color-soft-2);
  color: var(--color-muted);
  font-size: 0.95rem;
  text-align: center;
}

.auth-switch a {
  position: relative;
  color: var(--color-primary);
  font-weight: 700;
  transition: color var(--transition-fast);
}

.auth-switch a::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 1px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-normal);
}

.auth-switch a:hover {
  color: var(--color-primary-dark);
}

.auth-switch a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Forgot password link */
.auth-forgot {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.auth-forgot:hover {
  color: var(--color-primary);
}

/* ========================================
   SOCIAL LOGIN BUTTONS
   ======================================== */

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: var(--color-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--color-soft-2);
}

.auth-social {
  display: grid;
  gap: 12px;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 14px 20px;
  background: var(--color-white);
  border: 2px solid var(--color-soft-2);
  border-radius: var(--radius);
  color: var(--color-ink-2);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.auth-social-btn:hover {
  border-color: var(--color-line);
  background: var(--color-soft);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========================================
   RESPONSIVE - AUTH PAGES
   ======================================== */

@media (max-width: 1024px) {
  .auth-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 560px;
    margin: 0 auto;
  }

  .auth-copy,
  .auth-panel {
    max-width: none;
    margin-left: 0;
  }

  .auth-copy {
    text-align: center;
    animation: fadeInUp 0.6s var(--ease-out) backwards;
    animation-delay: 0.1s;
  }

  .auth-features {
    justify-content: center;
  }

  .auth-panel {
    animation: fadeInUp 0.6s var(--ease-out) backwards;
    animation-delay: 0.2s;
  }
}

@media (max-width: 768px) {
  .auth-main {
    padding: 48px 0;
    min-height: calc(100vh - 68px);
  }

  .auth-copy h1 {
    font-size: 2.25rem;
  }

  .auth-copy p {
    font-size: 1rem;
  }

  .auth-panel {
    padding: 36px 28px;
    border-radius: var(--radius-lg);
  }

  .auth-panel__header {
    margin-bottom: 28px;
  }

  .auth-panel__header h2 {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .auth-main {
    padding: 32px 0;
  }

  .auth-grid {
    gap: 32px;
  }

  .auth-copy h1 {
    font-size: 1.85rem;
  }

  .auth-panel {
    padding: 28px 20px;
  }

  .auth-panel .field input {
    min-height: 52px;
    padding: 14px 16px;
  }

  .auth-panel .button {
    min-height: 52px;
  }

  /* Hide background animations on small screens */
  .auth-page::before,
  .auth-page::after {
    display: none;
  }
}

/* ========================================
   PASSWORD STRENGTH INDICATOR
   ======================================== */

.password-strength {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--color-soft-2);
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.password-strength.weak .password-strength-bar:nth-child(1) {
  background: var(--color-error);
}

.password-strength.medium .password-strength-bar:nth-child(1),
.password-strength.medium .password-strength-bar:nth-child(2) {
  background: var(--color-warning);
}

.password-strength.strong .password-strength-bar {
  background: var(--color-success);
}

/* ========================================
   LOADING STATE
   ======================================== */

.auth-loading {
  position: relative;
  pointer-events: none;
}

.auth-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-loading .button {
  color: transparent;
}

.auth-loading .button::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
