/* ==========================================================================
   ZyJobs Auth Pages Stylesheet
   Login, Register, OTP Verification — Premium Glassmorphism
   ========================================================================== */

/* ── Auth Body ───────────────────────────────────────────────────────────── */
.zy-auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: var(--zy-bg-primary);
}

/* ── Animated Background Orbs ────────────────────────────────────────────── */
.zy-auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.zy-auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: zy-orb-float 20s ease-in-out infinite;
}

.zy-auth-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.3) 0%, transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.zy-auth-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.25) 0%, transparent 70%);
  bottom: -10%;
  right: -5%;
  animation-delay: -7s;
}

.zy-auth-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, transparent 70%);
  top: 50%;
  left: 60%;
  animation-delay: -14s;
}

@keyframes zy-orb-float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -30px) scale(1.05);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(20px, 30px) scale(1.02);
  }
}

/* ── Auth Container ──────────────────────────────────────────────────────── */
.zy-auth-container {
  width: 100%;
  max-width: 440px;
  padding: var(--zy-space-xl);
  position: relative;
  z-index: 2;
}

/* ── Auth Brand ──────────────────────────────────────────────────────────── */
.zy-auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zy-space-sm);
  font-family: var(--zy-font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--zy-text-primary);
  text-decoration: none;
  margin-bottom: var(--zy-space-2xl);
}

.zy-auth-brand:hover {
  color: var(--zy-text-primary);
}

.zy-auth-brand .brand-icon {
  width: 44px;
  height: 44px;
  background: var(--zy-gradient-primary);
  border-radius: var(--zy-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* ── Auth Card ───────────────────────────────────────────────────────────── */
.zy-auth-card {
  padding: var(--zy-space-2xl);
  animation: zy-auth-enter 0.6s ease-out;
}

@keyframes zy-auth-enter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.zy-auth-header {
  text-align: center;
  margin-bottom: var(--zy-space-2xl);
}

.zy-auth-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--zy-space-lg);
  background: var(--zy-gradient-card);
  border: 1px solid var(--zy-glass-border);
  border-radius: var(--zy-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: var(--zy-accent-primary);
}

.zy-auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--zy-space-sm);
}

.zy-auth-subtitle {
  font-size: 0.9375rem;
  color: var(--zy-text-secondary);
}

/* ── Auth Form ───────────────────────────────────────────────────────────── */
.zy-auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--zy-space-lg);
}

.zy-auth-submit {
  width: 100%;
  margin-top: var(--zy-space-md);
}

/* ── Auth Footer Links ───────────────────────────────────────────────────── */
.zy-auth-footer {
  text-align: center;
  margin-top: var(--zy-space-xl);
  padding-top: var(--zy-space-xl);
  border-top: 1px solid var(--zy-glass-border);
}

.zy-auth-footer p {
  font-size: 0.9375rem;
  color: var(--zy-text-secondary);
}

.zy-auth-footer a {
  color: var(--zy-accent-primary);
  font-weight: 600;
}

.zy-auth-footer a:hover {
  color: var(--zy-accent-secondary);
}

/* ── OTP Input ───────────────────────────────────────────────────────────── */
.zy-otp-container {
  display: flex;
  gap: var(--zy-space-sm);
  justify-content: center;
  margin: var(--zy-space-xl) 0;
}

.zy-otp-input {
  width: 52px;
  height: 60px;
  text-align: center;
  font-family: var(--zy-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--zy-text-primary);
  background: var(--zy-bg-tertiary);
  border: 2px solid var(--zy-glass-border);
  border-radius: var(--zy-radius-md);
  outline: none;
  transition: all var(--zy-transition-fast);
}

.zy-otp-input:focus {
  border-color: var(--zy-accent-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  background: var(--zy-bg-secondary);
}

.zy-otp-input.filled {
  border-color: var(--zy-accent-success);
  background: rgba(16, 185, 129, 0.1);
}

.zy-otp-input.error {
  border-color: var(--zy-accent-danger);
  animation: zy-shake 0.4s ease-in-out;
}

@keyframes zy-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* ── Resend Timer ────────────────────────────────────────────────────────── */
.zy-resend-timer {
  text-align: center;
  font-size: 0.875rem;
  color: var(--zy-text-muted);
  margin-top: var(--zy-space-lg);
}

.zy-resend-timer button {
  background: none;
  border: none;
  color: var(--zy-accent-primary);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.zy-resend-timer button:hover:not(:disabled) {
  color: var(--zy-accent-secondary);
}

.zy-resend-timer button:disabled {
  color: var(--zy-text-muted);
  cursor: not-allowed;
}

/* ── Alert Messages ──────────────────────────────────────────────────────── */
.zy-auth-alert {
  display: flex;
  align-items: center;
  gap: var(--zy-space-sm);
  padding: var(--zy-space-md) var(--zy-space-lg);
  border-radius: var(--zy-radius-md);
  font-size: 0.875rem;
  margin-bottom: var(--zy-space-lg);
}

.zy-auth-alert i {
  font-size: 1.25rem;
}

.zy-auth-alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--zy-accent-success);
}

.zy-auth-alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--zy-accent-danger);
}

.zy-auth-alert-info {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--zy-accent-primary);
}

/* ── Back Link ───────────────────────────────────────────────────────────── */
.zy-auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--zy-space-sm);
  margin-top: var(--zy-space-xl);
  font-size: 0.9375rem;
  color: var(--zy-text-muted);
  transition: color var(--zy-transition-fast);
}

.zy-auth-back:hover {
  color: var(--zy-text-primary);
}

/* ── Forgot Password Link & Modal ────────────────────────────────────────── */
.zy-auth-forgot {
  display: flex;
  justify-content: center;
  margin-top: var(--zy-space-md);
}

.zy-auth-forgot-link {
  display: inline-flex;
  align-items: center;
  gap: var(--zy-space-xs);
  background: none;
  border: none;
  padding: var(--zy-space-xs) var(--zy-space-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--zy-accent-tertiary);
  cursor: pointer;
  transition: color var(--zy-transition-fast);
}

.zy-auth-forgot-link:hover {
  color: var(--zy-accent-primary);
  text-decoration: underline;
}

.zy-modal .zy-auth-alert {
  margin-bottom: 0;
}

/* ── Password Toggle ─────────────────────────────────────────────────────── */
.zy-password-wrapper {
  position: relative;
}

.zy-password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--zy-text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  padding: var(--zy-space-xs);
  transition: color var(--zy-transition-fast);
}

.zy-password-toggle:hover {
  color: var(--zy-accent-primary);
}

/* ── Success State ───────────────────────────────────────────────────────── */
.zy-auth-success {
  text-align: center;
  padding: var(--zy-space-xl) 0;
}

.zy-auth-success-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--zy-space-xl);
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--zy-accent-success);
  animation: zy-success-pop 0.5s ease-out;
}

@keyframes zy-success-pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ── Responsive Design — Mobile First with clamp() Typography ───────────── */

/* Tablet & Small Screens */
@media (max-width: 768px) {
  .zy-auth-body {
    padding: var(--zy-space-md);
    overflow-y: auto;
  }
  
  .zy-auth-container {
    max-width: 100%;
    padding: var(--zy-space-md);
  }
  
  .zy-auth-card {
    padding: var(--zy-space-lg);
  }
  
  /* Responsive Typography with clamp() */
  .zy-auth-brand {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    margin-bottom: var(--zy-space-xl);
  }
  
  .zy-auth-brand .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.25rem;
  }
  
  .zy-auth-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    line-height: 1.3;
  }
  
  .zy-auth-subtitle {
    font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  }
  
  .zy-auth-icon {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
    margin-bottom: var(--zy-space-md);
  }
  
  /* OTP Inputs — Flex Wrap for small screens */
  .zy-otp-container {
    flex-wrap: wrap;
    gap: var(--zy-space-xs);
  }
  
  .zy-otp-input {
    width: clamp(40px, 12vw, 52px);
    height: clamp(48px, 14vw, 60px);
    font-size: clamp(1.125rem, 4vw, 1.5rem);
  }
  
  /* Form Inputs */
  .zy-input {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    padding: clamp(0.625rem, 2vw, 0.875rem) clamp(0.75rem, 2.5vw, 1rem);
  }
  
  .zy-label {
    font-size: clamp(0.8125rem, 2.5vw, 0.875rem);
  }
  
  /* Buttons */
  .zy-btn {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    padding: clamp(0.625rem, 2vw, 0.875rem) clamp(1rem, 3vw, 1.5rem);
  }
  
  .zy-btn-lg {
    width: 100%;
  }
  
  /* Footer */
  .zy-auth-footer {
    margin-top: var(--zy-space-lg);
    padding-top: var(--zy-space-lg);
  }
  
  .zy-auth-footer p {
    font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
  }
  
  /* Alerts */
  .zy-auth-alert {
    font-size: clamp(0.75rem, 2.5vw, 0.875rem);
    padding: var(--zy-space-sm) var(--zy-space-md);
  }
  
  /* Success State */
  .zy-auth-success-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
}

/* Extra Small Screens (Phones < 400px) */
@media (max-width: 400px) {
  .zy-auth-body {
    padding: var(--zy-space-sm);
    align-items: flex-start;
    padding-top: var(--zy-space-xl);
  }
  
  .zy-auth-container {
    padding: var(--zy-space-sm);
  }
  
  .zy-auth-card {
    padding: var(--zy-space-md);
  }
  
  .zy-auth-brand {
    font-size: 1.25rem;
  }
  
  .zy-auth-brand .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  .zy-otp-container {
    gap: 6px;
  }
  
  .zy-otp-input {
    width: 38px;
    height: 46px;
    font-size: 1rem;
  }
  
  /* Stack form rows on very small screens */
  .zy-form-row {
    flex-direction: column;
    gap: var(--zy-space-md);
  }
}

/* Landscape Phones */
@media (max-height: 500px) and (orientation: landscape) {
  .zy-auth-body {
    align-items: flex-start;
    padding-top: var(--zy-space-lg);
    overflow-y: auto;
  }
  
  .zy-auth-container {
    margin: var(--zy-space-md) auto;
  }
}
