/* Authentication Pages and User Dropdowns */

/* Auth pages main layout */
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px); /* Reduce extra space */
  padding: 20px;
}

.auth-container {
  width: 100%;
  max-width: 480px;
}

.auth-form {
  margin: 0;
}

.auth-content {
  padding: 12px 0; /* Reduce padding */
}

.subtitle {
  color: var(--muted);
  margin: 4px 0 20px; /* Reduce margins */
  font-size: 0.9rem;
  display: block; /* Ensure it's on its own line */
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.auth-footer p {
  color: var(--muted);
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.link-btn:hover {
  color: var(--accent-hover, #C09A38);
}

/* Card head spacing on auth pages */
.auth-container .card-head {
  margin-bottom: 20px;
}

/* Auth form overrides for better layout */
.auth-form .form-grid {
  grid-template-columns: 1fr 1fr; /* Two columns for name fields */
  gap: 16px;
}

/* First and last name on same row */
.auth-form .form-grid label:nth-child(1),
.auth-form .form-grid label:nth-child(2) {
  /* First Name and Last Name - keep in grid */
}

/* Email and Password full width */
.auth-form .form-grid label:nth-child(3),
.auth-form .form-grid label:nth-child(4) {
  grid-column: 1 / -1; /* Full width */
}

.auth-form .form-grid label {
  font-size: 14px;
  font-weight: 500;
}

.form-grid small {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 2px;
}

.form-actions {
  margin-top: 24px;
}

.form-actions button {
  width: 100%;
}

/* Messages */
.message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 0.9rem;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.message.info {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Email verification page */
.loading-spinner {
  text-align: center;
  padding: 40px 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.success-message,
.error-message {
  text-align: center;
  padding: 40px 20px;
}

.success-icon,
.error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.success-icon {
  color: #4ade80;
}

.error-icon {
  color: #f87171;
}

.success-message h3,
.error-message h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

.success-message p,
.error-message p {
  margin: 0 0 24px;
  color: var(--muted);
}

.error-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.primary-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.primary-btn:hover {
  background: var(--accent-hover, #C09A38);
}

.secondary-btn {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
}

.secondary-btn:hover {
  background: var(--panel);
  color: var(--ink);
}

.resend-section {
  margin-top: 32px;
  padding: 24px;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.resend-section h4 {
  margin: 0 0 16px;
  color: var(--ink);
}

.resend-section form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.resend-section button {
  align-self: flex-start;
}

/* User Dropdown Styles */
.user-dropdown {
  position: relative;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  padding: 8px 0;
}

.user-dropdown-menu.hidden {
  display: none;
}

.dropdown-separator {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}