/* ============================================ */
/* AgriMap — Auth UI styles                    */
/* Loaded on all pages via head-common.ejs     */
/* ============================================ */

.hidden { display: none !important; }

/* ── Header auth container ── */
.auth-container {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.auth-button {
  background: var(--color-brand-gradient);
  color: var(--color-text-inverted);
  border: none;
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  font-family: var(--font-family-base);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration-normal), transform var(--duration-normal);
}

.auth-button:hover {
  box-shadow: var(--shadow-hover-brand);
  transform: translateY(-1px);
}

.auth-button-outline {
  background: var(--color-bg-primary);
  color: var(--color-text-secondary);
  border: var(--border-width-thin) solid var(--color-border-subtle);
  box-shadow: var(--shadow-xs);
}

.auth-button-outline:hover {
  background: var(--color-bg-hover);
  box-shadow: var(--shadow-sm);
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-name {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Auth modal ── */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-backdrop.hidden {
  display: none;
}

.auth-modal {
  background: var(--color-bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-14);
  width: 100%;
  max-width: 400px;
  position: relative;
}

.auth-modal h2 {
  font-size: var(--font-size-4xl);
  color: var(--color-text-primary);
  margin-bottom: var(--space-10);
  text-align: center;
}

.auth-modal-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-6);
  background: none;
  border: none;
  font-size: var(--font-size-4xl);
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
}

.auth-modal-close:hover {
  color: var(--color-text-primary);
}

.auth-form-group {
  margin-bottom: var(--space-7);
}

.auth-form-group label {
  display: block;
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.auth-form-group input {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  border: var(--border-width-thin) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-family: var(--font-family-base);
  color: var(--color-text-primary);
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}

.auth-form-group input:focus {
  outline: none;
  border-color: var(--color-interactive);
  box-shadow: var(--shadow-focus-brand);
}

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

.auth-error {
  background: #fef2f2;
  color: var(--color-error);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-6);
  border: var(--border-width-thin) solid #fecaca;
}

.auth-success {
  background: #f0fdf4;
  color: #166534;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-6);
  border: var(--border-width-thin) solid #bbf7d0;
}

.auth-submit-btn {
  width: 100%;
  padding: var(--space-5) var(--space-8);
  background: var(--color-brand-gradient);
  color: var(--color-text-inverted);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  font-family: var(--font-family-base);
  transition: box-shadow var(--duration-normal), transform var(--duration-normal);
}

.auth-submit-btn:hover {
  box-shadow: var(--shadow-hover-brand);
  transform: translateY(-1px);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-switch {
  text-align: center;
  margin-top: var(--space-8);
  font-size: var(--font-size-md);
  color: var(--color-text-muted);
}

.auth-switch a {
  color: var(--color-brand-secondary);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-forgot-link {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
  text-decoration: none;
}
.auth-forgot-link:hover {
  color: var(--color-brand-secondary);
  text-decoration: underline;
}

.auth-button-small {
  background: none;
  color: var(--color-text-muted);
  border: var(--border-width-thin) solid var(--color-border-subtle);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  cursor: pointer;
  font-family: var(--font-family-base);
  transition: background var(--duration-normal), color var(--duration-normal);
}
.auth-button-small:hover {
  background: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* ── Email verification banner ── */
.email-verify-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1500;
  background: linear-gradient(135deg, var(--color-warning-banner-bg-start) 0%, var(--color-warning-banner-bg-end) 100%);
  border-bottom: var(--border-width-thin) solid var(--color-warning-banner-border);
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-md);
  color: var(--color-warning-banner-text);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
}
.email-verify-banner a {
  color: var(--color-brand-secondary);
  font-weight: var(--font-weight-semibold);
  text-decoration: underline;
  cursor: pointer;
}
.email-verify-dismiss {
  background: none;
  border: none;
  font-size: var(--font-size-xl);
  cursor: pointer;
  color: var(--color-warning-banner-text);
  padding: 0 var(--space-3);
  line-height: 1;
}

/* ── Toast notification ── */
.auth-toast {
  position: fixed;
  top: var(--space-8);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--color-text-primary);
  color: var(--color-text-inverted);
  padding: var(--space-5) var(--space-8);
  border-radius: var(--radius-md);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Mobile auth ── */
@media (max-width: 768px) {
  .auth-button {
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-xs);
  }

  .user-name { display: none; }

  .auth-modal {
    margin: var(--space-5);
    max-width: none;
    padding: var(--space-9);
  }
}
