/* ============================================
   Auth Splash Screen
   ============================================ */

.auth-splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23b8956e' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--color-paper) 0%, var(--color-paper-warm) 100%);
  padding: var(--space-6);
  overflow-y: auto;
}

.auth-splash.hidden {
  display: none;
}

.auth-splash-content {
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.auth-logo {
  margin-bottom: var(--space-6);
  animation: auth-fade-in 600ms var(--ease-out) both;
}

.auth-logo-icon {
  width: 72px;
  height: 72px;
  color: var(--color-brass);
  filter: drop-shadow(0 2px 4px rgba(184, 149, 110, 0.3));
}

.auth-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-1) 0;
  letter-spacing: var(--tracking-tight);
  animation: auth-slide-up 600ms var(--ease-out) 150ms both;
}

.auth-subtitle {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-river);
  margin: 0 0 var(--space-4) 0;
  font-weight: 500;
  font-style: italic;
  animation: auth-slide-up 600ms var(--ease-out) 250ms both;
}

.auth-tagline {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--leading-relaxed);
  animation: auth-slide-up 600ms var(--ease-out) 350ms both;
}

.auth-forms {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  position: relative;
  isolation: isolate;
  pointer-events: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: auth-scale-in 500ms var(--ease-out) 450ms both;
}

/* Auth splash entrance animations */
@keyframes auth-fade-in {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes auth-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-scale-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-forms * {
  pointer-events: auto;
}

/* Heritage decorative accent line */
.auth-forms::before {
  content: '';
  position: absolute;
  top: 0;
  left: var(--space-6);
  right: var(--space-6);
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--color-brass), transparent);
  border-radius: 0 0 2px 2px;
  pointer-events: none;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.auth-form.hidden {
  display: none;
}

.auth-form .form-group {
  text-align: left;
}

.auth-form label {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.auth-form input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-primary);
  transition: all var(--duration-normal) var(--ease-out);
  box-sizing: border-box;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-brass);
  box-shadow: 0 0 0 3px rgba(184, 149, 110, 0.2);
}

/* Brass accent underline on focus */
.auth-form input:focus {
  border-bottom-width: 2px;
  border-bottom-color: var(--color-brass);
}

.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-form .form-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Inline field-level errors in auth forms */
.auth-form .field-error {
  text-align: left;
}

.auth-error {
  background: var(--color-error-bg);
  color: var(--color-error);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: left;
}

.auth-error.hidden {
  display: none;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  z-index: 1;
}

.auth-btn:focus {
  outline: none;
}

.auth-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.auth-btn-primary {
  background: var(--color-brass);
  color: white;
}

.auth-btn-primary:hover {
  background: var(--color-brass-dark);
}

.auth-btn-primary:active {
  transform: scale(0.98);
}

.auth-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.auth-btn .btn-spinner {
  width: var(--icon-sm);
  height: var(--icon-sm);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.auth-btn .btn-spinner.hidden {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.auth-toggle {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-light);
  position: relative;
  z-index: 1;
}

.auth-toggle p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.auth-toggle p.hidden {
  display: none;
}

.auth-link {
  background: none;
  border: none;
  color: var(--color-river);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
  transition: color var(--duration-normal) var(--ease-out);
  position: relative;
  z-index: 1;
}

.auth-link:hover {
  color: var(--color-river-light);
  text-decoration: underline;
}

.auth-link:focus {
  outline: none;
}

.auth-link:focus-visible {
  text-decoration: underline;
  outline: 2px solid var(--color-river);
  outline-offset: 2px;
}

/* Dark mode adjustments */
[data-theme="dark"] .auth-splash {
  background:
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a882' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, var(--color-paper) 0%, var(--color-paper-warm) 100%);
}

[data-theme="dark"] .auth-forms {
  background: var(--card-bg);
  border-color: var(--border-default);
}

[data-theme="dark"] .auth-forms::before {
  background: linear-gradient(90deg, transparent, var(--color-brass-muted), transparent);
}

[data-theme="dark"] .auth-form input {
  background: var(--input-bg);
  border-color: var(--border-default);
}

[data-theme="dark"] .auth-form input:focus {
  border-color: var(--color-brass-muted);
  box-shadow: 0 0 0 3px rgba(201, 168, 130, 0.15);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .auth-splash {
    padding: var(--space-md);
  }

  .auth-forms {
    padding: var(--space-lg);
  }

  .auth-title {
    font-size: var(--text-xl);
  }
}
