/* ========================================
   MatDB — Auth Pages (Login / Signup)
   ======================================== */

.auth-page {
  background: var(--mat-bg);
  min-height: 100vh;
  margin: 0;
}

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

/* Decorative blurred shapes */
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.auth-bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .12;
}
.auth-bg-shape--1 {
  width: 500px; height: 500px;
  background: var(--mat-primary);
  top: -10%; left: -10%;
}
.auth-bg-shape--2 {
  width: 400px; height: 400px;
  background: #7c3aed;
  bottom: -10%; right: -5%;
}
.auth-bg-shape--3 {
  width: 300px; height: 300px;
  background: #06b6d4;
  top: 40%; right: 30%;
  opacity: .08;
}

/* Card */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--mat-surface);
  border: 1px solid var(--mat-border);
  border-radius: .875rem;
  box-shadow: var(--mat-shadow-lg, 0 8px 30px rgba(0,0,0,.12));
  padding: 2.25rem 2rem 1.75rem;
}

/* Logo */
.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--mat-border);
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1;
  text-align: center;
  padding: .625rem 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--mat-text-secondary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s ease, border-color .15s ease;
}
.auth-tab:hover {
  color: var(--mat-text);
}
.auth-tab--active {
  color: var(--mat-primary);
  border-bottom-color: var(--mat-primary);
}

/* Alerts */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .625rem .75rem;
  border-radius: .5rem;
  font-size: .8125rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}
.auth-alert i {
  flex-shrink: 0;
  margin-top: .1rem;
}
.auth-alert--error {
  background: color-mix(in srgb, #ef4444 10%, var(--mat-surface));
  color: #ef4444;
  border: 1px solid color-mix(in srgb, #ef4444 25%, transparent);
}
.auth-alert--success {
  background: color-mix(in srgb, #22c55e 10%, var(--mat-surface));
  color: #22c55e;
  border: 1px solid color-mix(in srgb, #22c55e 25%, transparent);
}

/* Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Field */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: .375rem;
}
.auth-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--mat-text-secondary);
  display: flex;
  align-items: center;
  gap: .375rem;
}
.auth-label i {
  font-size: .8125rem;
}
.auth-input {
  width: 100%;
  padding: .625rem .75rem;
  font-size: .875rem;
  font-family: inherit;
  color: var(--mat-text);
  background: var(--mat-bg);
  border: 1px solid var(--mat-border);
  border-radius: .5rem;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-input::placeholder {
  color: var(--mat-text-muted);
}
.auth-input:focus {
  border-color: var(--mat-primary);
  box-shadow: 0 0 0 3px var(--mat-primary-subtle);
}
.auth-field--error .auth-input {
  border-color: #ef4444;
}
.auth-field--error .auth-input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 15%, transparent);
}
.auth-field--error .auth-label {
  color: #ef4444;
}
.auth-field-error {
  font-size: .75rem;
  color: #ef4444;
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-top: -.125rem;
}
.auth-field-error i {
  font-size: .6875rem;
  flex-shrink: 0;
}

/* Password wrapper with toggle */
.auth-password-wrapper {
  position: relative;
}
.auth-password-wrapper .auth-input {
  padding-right: 2.75rem;
}
.auth-password-toggle {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--mat-text-muted);
  cursor: pointer;
  padding: .25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .25rem;
  transition: color .15s ease;
}
.auth-password-toggle:hover {
  color: var(--mat-text-secondary);
}

/* Options row */
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-check {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .8125rem;
  color: var(--mat-text-secondary);
  cursor: pointer;
}
.auth-check input[type="checkbox"] {
  accent-color: var(--mat-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Turnstile widget */
.auth-turnstile {
  display: flex;
  justify-content: center;
}

/* Submit button */
.auth-submit {
  width: 100%;
  padding: .7rem 1rem;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--mat-primary);
  border: none;
  border-radius: .5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
  margin-top: .25rem;
}
.auth-submit:hover {
  background: var(--mat-primary-hover, #3451d1);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--mat-primary) 35%, transparent);
}
.auth-submit:active {
  transform: scale(.985);
}

/* Password hints */
.auth-hints {
  list-style: none;
  padding: 0;
  margin: -.25rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.auth-hints li {
  font-size: .6875rem;
  color: var(--mat-text-muted);
  display: flex;
  align-items: center;
  gap: .25rem;
  transition: color .2s ease;
}
.auth-hints li i {
  font-size: .75rem;
  flex-shrink: 0;
  width: .875rem;
  text-align: center;
}
.auth-hint--pass {
  color: #22c55e;
}
.auth-hint--fail {
  color: #ef4444;
}

/* Footer link */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--mat-border-subtle);
  font-size: .8125rem;
  color: var(--mat-text-secondary);
}
.auth-footer a {
  color: var(--mat-primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: .25rem;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* Social login divider */
.auth-social-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
}
.auth-social-divider::before,
.auth-social-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--mat-border);
}
.auth-social-divider span {
  font-size: .75rem;
  font-weight: 500;
  color: var(--mat-text-secondary);
  white-space: nowrap;
}

/* Social login buttons */
.auth-social-buttons {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .625rem;
  width: 100%;
  padding: .625rem 1rem;
  font-size: .8125rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--mat-border);
  border-radius: .5rem;
  background: var(--mat-surface);
  color: var(--mat-text);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease,
              box-shadow .15s ease, transform .1s ease;
}
.auth-social-btn:hover {
  background: var(--mat-hover-bg);
  border-color: var(--mat-text-secondary);
  box-shadow: var(--mat-shadow-sm);
  text-decoration: none;
  color: var(--mat-text);
}
.auth-social-btn:active {
  transform: scale(.985);
}
.auth-social-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.auth-social-btn--google:hover { border-color: #4285F4; }
.auth-social-btn--facebook:hover { border-color: #1877F2; }
.auth-social-btn--twitter_oauth2:hover { border-color: var(--mat-text); }
.auth-social-btn--microsoft:hover { border-color: #00A4EF; }

/* Mobile */
@media (max-width: 480px) {
  .auth-card {
    padding: 1.75rem 1.25rem 1.5rem;
    border-radius: .75rem;
  }
}
