/* Shared auth page polish for login and register. */
html,
body.auth-page {
  min-height: 100%;
}

body.auth-page {
  background: transparent !important;
  color: #ffffff;
  display: block;
  padding: 0;
}

body.auth-page .main-content {
  min-height: 100vh;
  width: 100%;
  padding: clamp(6.5rem, 12vh, 8rem) clamp(1rem, 4vw, 3rem) clamp(2rem, 6vh, 4rem);
  display: grid;
  place-items: center;
}

body.auth-page .login-container,
body.auth-page .register-container {
  width: min(100%, var(--auth-card-width, 440px));
  position: relative;
  z-index: 1;
  padding: clamp(1.8rem, 4vw, 2.75rem);
  border-radius: 1.5rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.auth-page .register-container {
  --auth-card-width: 520px;
}

body.auth-page .login-container::before,
body.auth-page .register-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
  -webkit-mask: none;
  mask: none;
  animation: none;
  pointer-events: none;
}

body.auth-page .login-container::after,
body.auth-page .register-container::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: calc(1.5rem - 1px);
  background:
    radial-gradient(circle at 24% 0%, rgba(99, 102, 241, 0.14), transparent 38%),
    radial-gradient(circle at 96% 12%, rgba(236, 72, 153, 0.1), transparent 34%);
  pointer-events: none;
}

body.auth-page .login-header,
body.auth-page .register-header {
  margin-bottom: clamp(1.6rem, 4vw, 2.15rem);
  text-align: left;
}

body.auth-page .login-logo,
body.auth-page .register-logo {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.54);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: none;
}

body.auth-page .login-header h2,
body.auth-page .register-header h2 {
  margin: 0 0 0.55rem;
  color: #ffffff;
  font-size: clamp(2rem, 5vw, 2.55rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 0 22px rgba(255, 255, 255, 0.2);
}

body.auth-page .login-header p,
body.auth-page .register-header p,
body.auth-page .login-footer p,
body.auth-page .register-footer p {
  color: rgba(255, 255, 255, 0.68);
}

body.auth-page .form-row {
  gap: 0.85rem;
}

body.auth-page .form-field {
  margin-bottom: 1.25rem;
}

body.auth-page .form-field label {
  position: static;
  display: block;
  margin: 0 0 0.45rem;
  transform: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  pointer-events: auto;
}

body.auth-page .form-field.focused label,
body.auth-page .form-field.has-value label {
  position: static;
  transform: none;
  color: #ffffff;
  background: transparent;
  padding: 0;
  left: auto;
  top: auto;
  text-shadow: none;
}

body.auth-page .form-field .field-icon {
  color: rgba(255, 255, 255, 0.48);
}

body.auth-page .form-field.focused .field-icon {
  color: #ffffff;
}

body.auth-page .form-field input[type="text"],
body.auth-page .form-field input[type="email"],
body.auth-page .form-field input[type="password"],
body.auth-page .form-field input {
  min-height: 50px;
  padding-left: 44px;
  background: rgba(255, 255, 255, 0.045);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 0.85rem;
  box-shadow: none;
}

body.auth-page .form-field input[type="text"]:focus,
body.auth-page .form-field input[type="email"]:focus,
body.auth-page .form-field input[type="password"]:focus,
body.auth-page .form-field input:focus {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

body.auth-page .form-field::after {
  display: none;
}

body.auth-page .login-button,
body.auth-page .register-button {
  min-height: 50px;
  margin-bottom: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.94);
  color: #111827;
  text-shadow: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.auth-page .login-button:hover,
body.auth-page .register-button:hover {
  background: #ffffff;
  color: #111827;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26), 0 0 22px rgba(255, 255, 255, 0.1);
  text-shadow: none;
}

body.auth-page .divider {
  margin: 0.25rem 0 1rem;
}

body.auth-page .divider::before,
body.auth-page .divider::after {
  background: rgba(255, 255, 255, 0.1);
}

body.auth-page .divider span {
  color: rgba(255, 255, 255, 0.42);
}

body.auth-page .login-footer a,
body.auth-page .register-footer a,
body.auth-page .terms-dropdown .terms-content a {
  color: #ffffff;
  font-weight: 700;
  text-shadow: none;
}

body.auth-page .login-footer a:hover,
body.auth-page .register-footer a:hover {
  color: #ffffff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.34);
}

body.auth-page .error-message {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
}

body.auth-page .info-box,
body.auth-page .success-box,
body.auth-page .invalid-link {
  margin-bottom: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  text-align: left;
  line-height: 1.65;
}

body.auth-page .info-box {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.24);
}

body.auth-page .success-box {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.24);
}

body.auth-page .invalid-link {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
}

body.auth-page .info-box p,
body.auth-page .success-box p,
body.auth-page .invalid-link p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  text-shadow: none;
}

body.auth-page .info-box p + p,
body.auth-page .success-box p + p,
body.auth-page .invalid-link p + p {
  margin-top: 0.65rem !important;
}

body.auth-page .invalid-link h3 {
  margin: 0 0 0.55rem;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
}

body.auth-page .password-requirements,
body.auth-page .terms-dropdown,
body.auth-page .terms-toggle-btn,
body.auth-page .strength-bar {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.12);
}

body.auth-page .terms-toggle-btn {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.76);
}

body.auth-page .terms-toggle-btn:hover,
body.auth-page .terms-toggle-btn:focus {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

body.auth-page .terms-checkbox label,
body.auth-page .password-requirements small,
body.auth-page .terms-dropdown .terms-content,
body.auth-page .terms-dropdown .terms-content p,
body.auth-page .terms-dropdown .terms-content ul {
  color: rgba(255, 255, 255, 0.7);
}

body.auth-page .terms-dropdown .terms-content h3 {
  color: #ffffff;
}

html[data-theme="light"] body.auth-page {
  background: transparent !important;
  color: #111827;
}

html[data-theme="light"] body.auth-page .login-container,
html[data-theme="light"] body.auth-page .register-container {
  background: rgba(255, 255, 255, 0.34) !important;
  border-color: rgba(17, 24, 39, 0.14) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 14px 36px rgba(17, 24, 39, 0.08) !important;
  backdrop-filter: blur(22px) saturate(1.25);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
}

html[data-theme="light"] body.auth-page .login-container::before,
html[data-theme="light"] body.auth-page .register-container::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.42) 0%, transparent 54%);
}

html[data-theme="light"] body.auth-page .login-container::after,
html[data-theme="light"] body.auth-page .register-container::after {
  background:
    radial-gradient(circle at 18% 0%, rgba(79, 70, 229, 0.1), transparent 38%),
    radial-gradient(circle at 100% 20%, rgba(6, 182, 212, 0.1), transparent 34%);
}

html[data-theme="light"] body.auth-page .login-logo,
html[data-theme="light"] body.auth-page .register-logo,
html[data-theme="light"] body.auth-page .login-header p,
html[data-theme="light"] body.auth-page .register-header p,
html[data-theme="light"] body.auth-page .login-footer p,
html[data-theme="light"] body.auth-page .register-footer p,
html[data-theme="light"] body.auth-page .divider span,
html[data-theme="light"] body.auth-page .strength-text,
html[data-theme="light"] body.auth-page .password-requirements small,
html[data-theme="light"] body.auth-page .password-requirements li,
html[data-theme="light"] body.auth-page .terms-checkbox label,
html[data-theme="light"] body.auth-page .terms-dropdown .terms-content,
html[data-theme="light"] body.auth-page .terms-dropdown .terms-content p,
html[data-theme="light"] body.auth-page .terms-dropdown .terms-content ul {
  color: rgba(17, 24, 39, 0.64) !important;
  text-shadow: none !important;
}

html[data-theme="light"] body.auth-page .login-header h2,
html[data-theme="light"] body.auth-page .register-header h2,
html[data-theme="light"] body.auth-page .terms-dropdown .terms-content h3 {
  color: #111827 !important;
  text-shadow: none !important;
}

html[data-theme="light"] body.auth-page .form-field label {
  color: rgba(17, 24, 39, 0.5) !important;
}

html[data-theme="light"] body.auth-page .form-field.focused label,
html[data-theme="light"] body.auth-page .form-field.has-value label {
  color: #111827 !important;
  background: transparent !important;
  padding: 0 !important;
}

html[data-theme="light"] body.auth-page .form-field .field-icon {
  color: rgba(17, 24, 39, 0.52) !important;
}

html[data-theme="light"] body.auth-page .form-field input[type="text"],
html[data-theme="light"] body.auth-page .form-field input[type="email"],
html[data-theme="light"] body.auth-page .form-field input[type="password"],
html[data-theme="light"] body.auth-page .form-field input {
  background: rgba(255, 255, 255, 0.36) !important;
  color: #111827 !important;
  border-color: rgba(17, 24, 39, 0.14) !important;
}

html[data-theme="light"] body.auth-page .form-field input[type="text"]:focus,
html[data-theme="light"] body.auth-page .form-field input[type="email"]:focus,
html[data-theme="light"] body.auth-page .form-field input[type="password"]:focus,
html[data-theme="light"] body.auth-page .form-field input:focus {
  background: rgba(255, 255, 255, 0.58) !important;
  border-color: rgba(79, 70, 229, 0.36) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}

html[data-theme="light"] body.auth-page .login-button,
html[data-theme="light"] body.auth-page .register-button {
  background: #111827 !important;
  border-color: #111827 !important;
  color: #ffffff !important;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16) !important;
}

html[data-theme="light"] body.auth-page .login-button:hover,
html[data-theme="light"] body.auth-page .register-button:hover {
  background: #000000 !important;
  border-color: #000000 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.auth-page .login-footer a,
html[data-theme="light"] body.auth-page .register-footer a {
  color: #4f46e5 !important;
}

html[data-theme="light"] body.auth-page .divider::before,
html[data-theme="light"] body.auth-page .divider::after {
  background: rgba(17, 24, 39, 0.12) !important;
}

html[data-theme="light"] body.auth-page .password-requirements,
html[data-theme="light"] body.auth-page .terms-dropdown,
html[data-theme="light"] body.auth-page .terms-toggle-btn,
html[data-theme="light"] body.auth-page .strength-bar {
  background: rgba(255, 255, 255, 0.3) !important;
  border-color: rgba(17, 24, 39, 0.12) !important;
}

html[data-theme="light"] body.auth-page .terms-toggle-btn {
  color: #111827 !important;
}

html[data-theme="light"] body.auth-page .error-message {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(220, 38, 38, 0.22) !important;
  color: #991b1b !important;
}

html[data-theme="light"] body.auth-page .info-box {
  background: rgba(79, 70, 229, 0.08) !important;
  border-color: rgba(79, 70, 229, 0.18) !important;
}

html[data-theme="light"] body.auth-page .success-box {
  background: rgba(22, 163, 74, 0.08) !important;
  border-color: rgba(22, 163, 74, 0.18) !important;
}

html[data-theme="light"] body.auth-page .invalid-link {
  background: rgba(239, 68, 68, 0.08) !important;
  border-color: rgba(220, 38, 38, 0.18) !important;
}

html[data-theme="light"] body.auth-page .info-box p,
html[data-theme="light"] body.auth-page .success-box p,
html[data-theme="light"] body.auth-page .invalid-link p {
  color: rgba(17, 24, 39, 0.68) !important;
}

html[data-theme="light"] body.auth-page .invalid-link h3 {
  color: #111827 !important;
}

html[data-theme="light"] body.auth-page .floating-lines-container {
  opacity: 0.78 !important;
}

@media (max-width: 768px) {
  body.auth-page .main-content {
    padding-top: 5.5rem;
  }

  body.auth-page .login-header,
  body.auth-page .register-header {
    text-align: left;
  }
}
