/**
 * BusinessListPK.com - Authentication Styles (Login & Register)
 * Focused, compact authentication layout inspired by GitHub's simplicity
 * Built strictly with approved design tokens and brand palette
 */

/* ==================================================
 * Page Shell & Centering
 * ================================================== */
.auth-page {
  background-color: var(--neutral-50, #FAF8F5);
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  font-family: var(--font-family-body);
  color: var(--color-text-primary, #1F1F1F);
  -webkit-font-smoothing: antialiased;
}

.auth-main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 64px;
  width: 100%;
  box-sizing: border-box;
}

.auth-container {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ==================================================
 * Authentication Header (Icon Mark & Heading)
 * ================================================== */
.auth-header {
  text-align: center;
  margin-bottom: var(--space-24, 24px);
}

.auth-header__icon-link {
  display: inline-block;
  margin-bottom: var(--space-16, 16px);
  text-decoration: none;
}

.auth-header__icon-link:focus-visible {
  outline: 2px solid var(--color-focus-ring, var(--brand-500));
  outline-offset: 4px;
  border-radius: var(--radius-sm, 6px);
}

.auth-header__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
  box-shadow: 0 2px 6px rgba(46, 24, 16, 0.08);
}

.auth-header__title {
  font-family: var(--font-family-heading);
  font-size: 24px;
  line-height: 1.25;
  font-weight: var(--font-weight-bold, 700);
  color: var(--neutral-900, #1E1C19);
  margin: 0 0 var(--space-8, 8px);
  letter-spacing: -0.4px;
}

.auth-header__subtitle {
  font-family: var(--font-family-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--neutral-600, #666057);
  margin: 0;
}

/* ==================================================
 * Authentication Form Card
 * ================================================== */
.auth-box {
  background-color: #FFFFFF;
  border: 1px solid var(--neutral-300, #D4CDC2);
  border-radius: var(--radius-md, 8px);
  padding: 24px;
  box-sizing: border-box;
  box-shadow: 0 1px 3px rgba(30, 28, 25, 0.04);
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.form-group {
  margin-bottom: var(--space-16, 16px);
  display: flex;
  flex-direction: column;
}

.form-group:last-of-type {
  margin-bottom: var(--space-20, 20px);
}

.form-label {
  font-family: var(--font-family-body);
  font-size: 14px;
  font-weight: var(--font-weight-semibold, 600);
  color: var(--neutral-900, #1E1C19);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-label__required {
  color: var(--brand-500, #C55A32);
}

.form-control {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font-family-body);
  color: var(--neutral-900, #1E1C19);
  background-color: #FFFFFF;
  border: 1px solid var(--neutral-300, #D4CDC2);
  border-radius: 6px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control::placeholder {
  color: var(--neutral-400, #B5ADA0);
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-500, #C55A32);
  box-shadow: 0 0 0 3px rgba(197, 90, 50, 0.15);
}

.form-control.is-invalid {
  border-color: var(--error, #D9383A);
  background-color: #FFFDFD;
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(217, 56, 58, 0.15);
}

/* ==================================================
 * Password Input with Show/Hide Toggle
 * ================================================== */
.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrapper .form-control {
  padding-right: 42px;
}

.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--neutral-500, #8C8479);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.password-toggle-btn:hover {
  color: var(--neutral-800, #2C2925);
  background-color: var(--neutral-100, #F5F2EB);
}

.password-toggle-btn:focus-visible {
  outline: 2px solid var(--brand-500, #C55A32);
  outline-offset: 1px;
}

.password-toggle-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Password Rules List */
.password-rules {
  margin: 6px 0 0 0;
  padding: 0 0 0 16px;
  list-style-type: disc;
  font-family: var(--font-family-body);
  font-size: 12px;
  color: var(--neutral-600, #666057);
  line-height: 1.5;
}

.password-rules li {
  margin-bottom: 2px;
}

/* Error Message */
.form-error-msg {
  display: none;
  font-family: var(--font-family-body);
  font-size: 12px;
  color: var(--error, #D9383A);
  margin-top: 5px;
  line-height: 1.4;
  font-weight: var(--font-weight-medium, 500);
}

.form-error-msg.is-visible {
  display: block;
}

/* ==================================================
 * Terracotta Action Button
 * ================================================== */
.form-submit-btn {
  width: 100%;
  height: 42px;
  background-color: var(--brand-500, #C55A32);
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-family: var(--font-family-body);
  font-size: 14px;
  font-weight: var(--font-weight-semibold, 600);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.form-submit-btn:hover {
  background-color: var(--brand-600, #A8572F);
}

.form-submit-btn:active {
  background-color: var(--brand-700, #8D4523);
}

.form-submit-btn:focus-visible {
  outline: 2px solid var(--brand-500, #C55A32);
  outline-offset: 2px;
}

/* ==================================================
 * Feedback / Warning Alert Banner
 * ================================================== */
.form-alert {
  display: none;
  padding: 12px 14px;
  border-radius: var(--radius-md, 6px);
  margin-bottom: var(--space-16, 16px);
  font-family: var(--font-family-body);
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

.form-alert.is-visible {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.form-alert__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-alert__content {
  flex-grow: 1;
}

.form-alert__title {
  font-weight: var(--font-weight-bold, 700);
  margin: 0 0 2px 0;
  display: block;
}

.form-alert__desc {
  margin: 0;
}

.form-alert--warning {
  background-color: var(--warning-bg, #FFF9EB);
  border: 1px solid #ECC973;
  color: #7A5300;
}

.form-alert--warning .form-alert__icon {
  color: var(--warning, #C88A00);
}

.form-alert--success {
  background-color: #F0FDF4;
  border: 1px solid #86EFAC;
  color: #166534;
}

.form-alert--success .form-alert__icon {
  color: #15803D;
}

.form-alert--error {
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.form-alert--error .form-alert__icon {
  color: #DC2626;
}

/* ==================================================
 * Secondary Bordered Box (New to BusinessListPK?)
 * ================================================== */
.auth-subbox {
  margin-top: var(--space-16, 16px);
  padding: 16px 20px;
  background-color: #FFFFFF;
  border: 1px solid var(--neutral-300, #D4CDC2);
  border-radius: var(--radius-md, 8px);
  text-align: center;
  font-family: var(--font-family-body);
  font-size: 14px;
  color: var(--neutral-700, #45403A);
  line-height: 1.5;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--space-8, 8px);
}

.auth-subbox__text {
  margin: 0;
}

.auth-subbox__link {
  color: var(--brand-600, #A8572F);
  font-weight: var(--font-weight-semibold, 600);
  text-decoration: none;
  transition: color 0.15s ease;
}

.auth-subbox__link:hover {
  color: var(--brand-700, #8D4523);
  text-decoration: underline;
}

.auth-subbox__link:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
  border-radius: 2px;
}

/* ==================================================
 * Responsive Behavior
 * ================================================== */
@media (max-width: 480px) {
  .auth-main {
    padding: 32px 16px 48px;
  }

  .auth-box {
    padding: 20px 16px;
  }

  .auth-header__title {
    font-size: 22px;
  }

  .auth-subbox {
    padding: 14px 16px;
  }
}
