/* === NEW AUTH PAGE DESIGN === */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--theme-bg-main);
  min-height: 100vh;
  color: var(--theme-text-primary);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(var(--color-accent-rgb), 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(var(--color-accent-rgb), 0.02) 0%, transparent 50%),
    var(--theme-bg-main);
}

/* Container */
.auth-container {
  width: 100%;
  max-width: 420px;
  perspective: 1000px;
}

/* Card */
.auth-card {
  background: var(--theme-bg-card);
  border: 1px solid var(--theme-border-subtle);
  border-radius: 24px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 0 0 1px var(--theme-bg-card),
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(var(--color-accent-rgb), 0.03);
}

/* Subtle glow effect on card */
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--color-accent-rgb), 0.3), transparent);
}

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

.auth-logo img {
  height: 48px;
  width: auto;
  opacity: 0.9;
}

/* Form wrapper for animations */
.auth-form-wrapper {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-form-hidden {
  display: none;
  opacity: 0;
  transform: translateY(10px);
}

.auth-form-visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
  animation: formSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Header */
.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--theme-text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  color: var(--theme-text-muted);
  font-size: 0.9rem;
}

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

/* Input group */
.auth-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 1rem;
  width: 18px;
  height: 18px;
  color: var(--theme-text-muted);
  pointer-events: none;
  transition: color 0.2s ease;
}

.auth-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background: var(--theme-bg-input);
  border: 1px solid var(--theme-border-medium);
  border-radius: 12px;
  color: var(--theme-text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

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

.auth-input:hover {
  background: var(--theme-bg-input);
  border-color: var(--theme-border-strong);
}

.auth-input:focus {
  outline: none;
  background: var(--theme-bg-input);
  border-color: rgba(var(--color-accent-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.auth-input:focus + .auth-input-icon,
.auth-input-group:focus-within .auth-input-icon {
  color: rgba(var(--color-accent-rgb), 0.7);
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: -0.2rem;
  padding: 0 0.1rem;
}

.auth-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-accent);
  cursor: pointer;
}

.auth-remember label {
  font-size: 0.85rem;
  color: var(--theme-text-secondary);
  cursor: pointer;
  user-select: none;
}

/* Button */
.auth-btn {
  padding: 0.875rem 1.5rem;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.auth-btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-soft) 100%);
  color: var(--theme-bg-main);
  margin-top: 0.5rem;
  box-shadow: 0 4px 20px rgba(var(--color-accent-rgb), 0.25);
}

.auth-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(var(--color-accent-rgb), 0.35);
}

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

/* Links */
.auth-link {
  background: none;
  border: none;
  color: var(--color-accent);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.auth-link-secondary {
  color: var(--theme-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.auth-link-secondary:hover {
  color: var(--theme-text-secondary);
}

/* Footer */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--theme-border-subtle);
}

/* Alerts/Errors */
.auth-error,
.auth-success {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.auth-error {
  background: rgba(220, 53, 69, 0.25);
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: #ff6070;
}

.auth-success {
  background: rgba(40, 167, 69, 0.25);
  border: 1px solid rgba(40, 167, 69, 0.45);
  color: #3dba5f;
}

.auth-error__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Flash messages inside auth forms */
.auth-form .card-flash {
  margin-bottom: 0;
}

.auth-error-list {
  margin: 0;
  padding-left: 1.2rem;
  text-align: left;
}

.auth-error-list li + li {
  margin-top: 0.25rem;
}

.password-rules {
  list-style: none;
  margin: -0.25rem 0 0;
  padding: 0 0.15rem;
  display: grid;
  gap: 0.25rem;
}

.password-rule {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.82rem;
  line-height: 1.25;
}

.password-rule::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.22rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.password-rule-invalid {
  color: #ff8a95;
}

.password-rule-invalid::before {
  background: rgba(220, 53, 69, 0.28);
  border: 1px solid rgba(220, 53, 69, 0.55);
}

.password-rule-valid {
  color: #7dd88e;
}

.password-rule-valid::before {
  background: rgba(40, 167, 69, 0.24);
  border: 1px solid rgba(40, 167, 69, 0.55);
}

/* Card flash close button */
.card-flash__close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
}

.card-flash__close:hover {
  opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
  .auth-page {
    padding: 1rem;
    align-items: flex-start;
    padding-top: 3rem;
  }
  
  .auth-card {
    padding: 1.75rem;
    border-radius: 20px;
  }
  
  .auth-header h1 {
    font-size: 1.5rem;
  }
  
  .auth-logo img {
    height: 40px;
  }
}

/* Animation for card entry */
@keyframes cardEntry {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.auth-card {
  animation: cardEntry 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Select dropdown styling */
.auth-form select.auth-input,
.auth-form .auth-input-group select,
select.auth-input {
  background-color: var(--theme-bg-input);
  border: 1px solid var(--theme-border-medium);
  color: var(--theme-text-primary);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Dropdown options */
.auth-form select option,
.auth-form select.auth-input option {
  background: var(--theme-bg-card);
  color: var(--theme-text-primary);
  padding: 0.75rem;
  font-size: 0.95rem;
}

/* Selected/hovered option */
.auth-form select option:checked,
.auth-form select option:hover {
  background: rgba(var(--color-accent-rgb), 0.2);
  color: var(--theme-text-primary);
}

/* Focus state */
.auth-form select:focus,
.auth-form select.auth-input:focus {
  outline: none;
  border-color: rgba(var(--color-accent-rgb), 0.4);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

/* Hover state */
.auth-form select:hover,
.auth-form select.auth-input:hover {
  background-color: var(--theme-border-medium);
}

/* Firefox specific styling */
@-moz-document url-prefix() {
  .auth-form select {
    background-color: var(--theme-bg-input);
    color: var(--theme-text-primary);
  }
  
  .auth-form select option {
    background: var(--theme-bg-card);
    color: var(--theme-text-primary);
  }
}
