/**
 * Modern Auth Styles
 * Premium, high-contrast, and professional aesthetic
 */

:root {
  --auth-primary: #0284c7;
  --auth-primary-dark: #0369a1;
  --auth-bg-gradient: linear-gradient(135deg, #07111f 0%, #0f2742 44%, #06283d 100%);
  --auth-card-bg: #ffffff;
  --auth-text-main: #1e293b;
  --auth-text-muted: #64748b;
  --auth-input-border: #e2e8f0;
  --auth-input-focus: #0284c7;
  --auth-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --auth-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #07111f;
  background-image:
    linear-gradient(118deg, rgba(14, 165, 233, 0.25), transparent 32%),
    linear-gradient(300deg, rgba(16, 185, 129, 0.16), transparent 34%),
    var(--auth-bg-gradient);
  background-size: 140% 140%, 130% 130%, 100% 100%;
  padding: 24px;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
  animation: authBackgroundShift 18s ease-in-out infinite alternate;
}

.auth-page::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(rgba(125, 211, 252, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, 0.12) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 20%, #000 78%, transparent 100%);
  animation: authGridDrift 22s linear infinite;
}

.auth-page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.14) 45%, transparent 62%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
  opacity: 0.7;
  transform: translateX(-20%);
  animation: authLightSweep 12s ease-in-out infinite;
}

.auth-bg-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-bg-scene__beam {
  position: absolute;
  width: 46vw;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(125, 211, 252, 0.8), rgba(255, 255, 255, 0.92), transparent);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.42);
  transform-origin: left center;
  opacity: 0.72;
  animation: authBeamTravel 9s ease-in-out infinite;
}

.auth-bg-scene__beam--one {
  top: 18%;
  left: -12%;
  transform: rotate(-16deg);
}

.auth-bg-scene__beam--two {
  top: 70%;
  right: -18%;
  width: 54vw;
  transform: rotate(14deg);
  animation-delay: -3s;
}

.auth-bg-scene__beam--three {
  top: 44%;
  left: 58%;
  width: 34vw;
  transform: rotate(78deg);
  animation-delay: -6s;
}

.auth-bg-scene__panel {
  position: absolute;
  width: 340px;
  height: 220px;
  border: 1px solid rgba(186, 230, 253, 0.18);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    linear-gradient(90deg, rgba(14, 165, 233, 0.18), transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 24px 80px rgba(0, 0, 0, 0.18);
  transform: perspective(900px) rotateX(62deg) rotateZ(-28deg);
  animation: authPanelFloat 16s ease-in-out infinite alternate;
}

.auth-bg-scene__panel--one {
  left: -80px;
  bottom: 8%;
}

.auth-bg-scene__panel--two {
  right: -120px;
  top: 10%;
  width: 420px;
  height: 260px;
  transform: perspective(900px) rotateX(60deg) rotateZ(22deg);
  animation-delay: -7s;
}

@keyframes authBackgroundShift {
  from { background-position: 0% 50%, 100% 50%, center; }
  to { background-position: 100% 50%, 0% 50%, center; }
}

@keyframes authGridDrift {
  from { background-position: 0 0, 0 0; }
  to { background-position: 112px 56px, 112px 56px; }
}

@keyframes authLightSweep {
  0%, 24% { transform: translateX(-42%); opacity: 0; }
  42%, 70% { opacity: 0.72; }
  100% { transform: translateX(42%); opacity: 0; }
}

@keyframes authBeamTravel {
  0%, 100% { opacity: 0.18; filter: blur(0); translate: 0 0; }
  45% { opacity: 0.88; filter: blur(0.2px); translate: 10vw 1.5vh; }
}

@keyframes authPanelFloat {
  from { translate: 0 0; opacity: 0.42; }
  to { translate: 24px -18px; opacity: 0.72; }
}

.auth-card {
  width: min(100%, 440px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  box-shadow: 0 32px 90px rgba(2, 8, 23, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.18);
  overflow: hidden;
  animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
  backdrop-filter: blur(18px);
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card__header {
  padding: 40px 40px 32px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.8)),
    linear-gradient(90deg, rgba(14, 165, 233, 0.1), transparent 55%, rgba(16, 185, 129, 0.08));
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
}

.auth-card__logo {
  height: 42px;
  width: auto;
  margin: 0 auto 20px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
}

.auth-card__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--auth-text-main);
  letter-spacing: 0;
}

.auth-card__subtitle {
  margin: 10px 0 0;
  color: var(--auth-text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-card__body {
  padding: 40px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-form__label {
  color: var(--auth-text-main);
  font-size: 0.875rem;
  font-weight: 600;
  margin-left: 2px;
}

.auth-form__input {
  width: 100%;
  height: 52px;
  border: 1.5px solid var(--auth-input-border);
  border-radius: 12px;
  padding: 0 16px;
  background: #ffffff;
  color: var(--auth-text-main);
  font-size: 1rem;
  transition: all 0.2s ease;
}

.auth-form__input:hover {
  border-color: #cbd5e1;
}

.auth-form__input:focus {
  outline: none;
  border-color: var(--auth-input-focus);
  box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

.auth-password {
  position: relative;
}

.auth-password .auth-form__input {
  padding-right: 56px;
}

.auth-password__toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #f1f5f9;
  color: var(--auth-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-password__toggle:hover {
  background: #e2e8f0;
  color: var(--auth-text-main);
}

.auth-form__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -8px;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--auth-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  user-select: none;
}

.auth-remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid #e2e8f0;
  accent-color: var(--auth-primary);
  cursor: pointer;
}

.auth-submit {
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--auth-primary), #0ea5e9);
  color: #ffffff;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.2);
  position: relative;
  overflow: hidden;
}

.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.36) 44%, transparent 66%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2, 132, 199, 0.3);
  filter: brightness(1.05);
}

.auth-submit:hover::before {
  transform: translateX(120%);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-error {
  display: none;
  margin-bottom: 24px;
  padding: 14px 18px;
  border-left: 4px solid #ef4444;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  line-height: 1.5;
}

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

.auth-card__footer {
  padding: 0 40px 40px;
  text-align: center;
}

.auth-card__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.auth-card__back::before {
  content: '←';
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .auth-page {
    padding: 16px;
  }

  .auth-card__header,
  .auth-card__body,
  .auth-card__footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .auth-bg-scene__panel {
    display: none;
  }

  .auth-bg-scene__beam {
    width: 76vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page,
  .auth-page::before,
  .auth-page::after,
  .auth-bg-scene__beam,
  .auth-bg-scene__panel,
  .auth-card,
  .auth-submit::before {
    animation: none;
    transition: none;
  }
}
