/* --------------------
   Core Layout Components
   -------------------- */

/* Main container with fixed positioning */
.auth-container {
  display: flex;
  min-height: 100vh;
  min-width: 100vw;
  background-color: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  overflow: hidden;
}

/* Left Panel: Yellow Background with Branding */
.auth-hero {
  width: 50%;
  background-color: #e3c934;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  display: none;
}

.auth-hero-content {
  margin-top: 6rem;
  margin-left: 3rem;
  margin-right: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100%;
}

/* Brand Header (Logo + Text) */
.auth-brand-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  height: auto;
  width: auto;
  max-height: 60px;
}

.brand-text {
  height: auto;
  width: auto;
  max-height: 40px;
}

/* Hero Text Block */
.auth-hero-text {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 571px;
}

.hero-title {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
  font-size: 2.25rem;
  line-height: 2.75rem;
  color: #000000;
  margin: 0;
}

.hero-description {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.5px;
  color: #4b5563;
  margin: 0;
}

/* Hero Footer */
.auth-hero-footer {
  margin-top: auto;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.hero-footer-text {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #4b5563;
}

.footer-separator {
  height: 0.375rem;
}

.hero-footer-link {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #4b5563;
  text-decoration: none;
  transition: text-decoration 0.2s;
}

.hero-footer-link:hover {
  text-decoration: underline;
}

/* Right Panel: White Background with Form */
.auth-form-column {
  width: 50%;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
  height: 100vh;
  position: relative;
}

/* Form wrapper - provides structure for form elements */
.auth-form-wrapper {
  width: 322px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --------------------
   Shared Form Components
   -------------------- */

.auth-logo {
  text-align: center;
  margin-top: var(--spacing-lg);
}

.auth-logo img {
  height: 5.5rem;
  width: auto;
}

/* Form content container */
.auth-form-content {
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-heading {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 2rem;
  color: #4b5563;
  margin: 0;
  text-align: left;
}

/* Description text for password reset pages */
.auth-description {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #4b5563;
  margin: 0;
}

/* Shared form elements with consistent spacing */
.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.875rem;
  color: #6b7280;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-group input::placeholder {
  color: #d1d5db;
  font-size: 0.875rem;
}

/* Checkbox styling */
.form-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.form-checkbox input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
}

.form-checkbox label {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 400;
  font-size: 0.875rem;
  color: #4b5563;
  margin: 0;
}

.form-actions {
  margin-top: 1rem;
  margin-bottom: 0;
}

/* Button styling */
.auth-button {
  display: block;
  width: 100%;
  background-color: #39251b;
  color: var(--white);
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    opacity 0.2s,
    box-shadow 0.2s;
}

.auth-button:hover {
  background-color: #1e3a8a;
}

.auth-button:focus,
.auth-button:focus-visible {
  outline: 2px solid #1e3a8a;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.2);
}
.auth-button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-form-content .form-group label {
  font-weight: var(--font-regular);
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--neutral-dark);
}

.auth-form-content .form-checkbox label {
  display: inline-block;
  margin-left: var(--spacing-xs);
  font-weight: var(--font-regular);
}

/* Target any potential CKAN overrides */
.auth-container label[for],
.auth-form-content label[for] {
  font-weight: var(--font-regular);
}

/* --------------------
   Link Components
   -------------------- */

/* Action links styling */
.auth-links {
  text-align: center;
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

.auth-links a {
  color: #39251b;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 0.875rem;
  text-decoration: none;
  transition: text-decoration 0.2s;
  font-weight: 600;
}

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

/* Login-specific link */
.auth-links--login {
  margin-top: 0.5rem;
}

/* Registration-specific link */
.auth-links--register {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

/* Return to login link */
.auth-links--return {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-links--return a {
  color: #4b5563;
  font-weight: 400;
}

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

/* Error message styling */
.error-explanation {
  color: #6b7280;
  border: 1px solid #d1d5db;
  background-color: #fef2f2;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 0.375rem;
}

/* Success message styling */
.success-message {
  color: #059669;
  border: 1px solid #86efac;
  background-color: #dcfce7;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 0.375rem;
}

/* Alert/flash message styling - scoped to auth pages only */
.auth-container .alert-success {
  color: #059669;
  border: 1px solid #86efac;
  background-color: #dcfce7;
  font-size: 0.875rem;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.auth-container .alert-error,
.auth-container .alert-danger {
  color: #6b7280;
  border: 1px solid #d1d5db;
  background-color: #fef2f2;
  font-size: 0.875rem;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

.auth-container .alert-info {
  color: #0369a1;
  border: 1px solid #7dd3fc;
  background-color: #e0f2fe;
  font-size: 0.875rem;
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
}

/* --------------------
   Footer Component
   -------------------- */

.auth-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--light-text-color);
  font-size: var(--text-xs);
  padding: var(--spacing-sm) 0;
  background-color: var(--white);
  z-index: 50;
}

/* --------------------
   Responsive Behavior
   -------------------- */

@media (min-width: 768px) {
  .auth-hero {
    display: flex;
  }

  .auth-container {
    flex-direction: row;
  }
}

@media (max-width: 767px) {
  .auth-container {
    flex-direction: column;
    min-height: 100vh;
  }

  .auth-hero {
    display: none;
  }

  .auth-form-column {
    width: 100%;
  }

  .auth-form-wrapper {
    width: 100%;
    max-width: 400px;
  }

  .auth-form-content {
    padding: 1rem;
  }
}

/* --------------------
   Alert/Error Messages
   -------------------- */

.flash-messages {
  margin-bottom: 1.5rem;
}

.flash-messages .alert {
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Alert variants */
.flash-messages .alert-danger,
.flash-messages .alert-error {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.flash-messages .alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.flash-messages .alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.flash-messages .alert-info {
  color: #004085;
  background-color: #d1ecf1;
  border-color: #bee5eb;
}

/* Close button */
.flash-messages .alert .close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  opacity: 0.5;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
}

.flash-messages .alert .close:hover {
  opacity: 0.75;
}

/* Form error styling */
.error-explanation {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 0.375rem;
  color: #721c24;
}

.error-explanation h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.error-explanation ul {
  margin: 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.error-explanation li {
  margin-bottom: 0.25rem;
}
