:root {
  --auth-red: #d91f11;
  --auth-red-dark: #b8170c;
  --auth-text: #111111;
  --auth-muted: #565656;
  --auth-border: #9f9f9f;
  --auth-surface: #ffffff;
  --auth-error: #c7362f;
  --auth-error-bg: #fff1f0;
  --auth-glow: rgba(217, 31, 17, 0.18);
  --auth-shadow: 0 24px 60px rgba(18, 24, 33, 0.12);
}

html,
body {
  background: #f3f0ea;
}

body.auth-page {
  min-height: 100vh;
}

body.auth-page .container-xxl {
  max-width: none;
  width: 100%;
  padding: 0;
  background: transparent !important;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  background:
    radial-gradient(
      circle at top left,
      rgba(255, 255, 255, 0.7),
      transparent 34%
    ),
    linear-gradient(135deg, #f7f4ef 0%, #f1ece4 100%);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 16px 52px 32px;
  background: #f8f8f8;
  font-family: "Inter", sans-serif;
  backdrop-filter: blur(12px);
}

.auth-panel-inner {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  width: 100%;
}

.auth-brand a {
  display: inline-flex;
  justify-content: center;
}

.auth-brand-logo {
  width: min(126px, 100%);
  height: auto;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.25));
}

.auth-brand-logo-mobile {
  display: none;
}

.auth-heading {
  margin-bottom: 24px;
  text-align: center;
}

.auth-heading h1 {
  margin: 0 0 14px;
  font-family: "Jost", sans-serif;
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 200 !important;
  color: var(--auth-text);
}

.auth-heading p {
  margin: 0;
  color: var(--auth-text);
  font-size: 1rem;
  line-height: 1.5;
  padding-top: 20px;
  padding-bottom: 20px;
}

.auth-form {
  display: grid;
  gap: 10px;
}

.auth-form-group {
  display: grid;
  gap: 6px;
}

.auth-form-group label,
.auth-checkbox-label,
.auth-link-row a,
.auth-secondary-link,
.auth-footer-links a {
  -webkit-tap-highlight-color: transparent;
}

.auth-form-group label,
.auth-checkbox-label {
  color: var(--auth-text);
  font-size: 1rem;
  font-weight: 500;
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--auth-border);
  border-radius: 16px;
  background: var(--auth-surface);
  color: var(--auth-text);
  font-size: 1rem;
  line-height: 1.4;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background-color 150ms ease,
    color 150ms ease,
    opacity 150ms ease;
}

.auth-input::placeholder {
  color: #777777;
}

.auth-input:focus {
  outline: none;
  border-color: var(--auth-red);
  box-shadow: 0 0 0 4px var(--auth-glow);
}

.auth-input[disabled] {
  cursor: not-allowed;
  opacity: 1;
  background: #e5e7eb;
  color: #6b7280;
}

.auth-input.has-toggle {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--auth-text);
  transform: translateY(-50%);
  transition:
    background-color 120ms ease,
    transform 120ms ease;
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: rgba(17, 17, 17, 0.06);
  outline: none;
}

.auth-password-toggle:active {
  transform: translateY(-50%) scale(0.98);
}

.auth-helper,
.auth-password-rules {
  min-height: 18px;
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-password-group .auth-helper,
.auth-password-group .auth-password-rules {
  display: none;
}

.auth-password-group.has-value .auth-helper,
.auth-password-group.has-value .auth-password-rules {
  display: block;
}

.auth-helper,
.auth-password-rules {
  color: var(--auth-muted);
}

.auth-field-error {
  display: none;
  color: var(--auth-error);
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-field-error.is-visible {
  display: block;
  animation: authFadeIn 150ms ease;
}

.auth-form-group.has-error .auth-input {
  border-color: var(--auth-error);
}

.auth-form-group.has-error .auth-input:focus {
  box-shadow: 0 0 0 4px rgba(199, 54, 47, 0.14);
}

.auth-server-error {
  display: none;
  margin-bottom: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(199, 54, 47, 0.24);
  border-radius: 16px;
  background: var(--auth-error-bg);
  color: var(--auth-error);
  font-size: 0.95rem;
  line-height: 1.4;
}

.auth-server-error.is-visible {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: authFadeIn 150ms ease;
}

.auth-server-error.is-success {
  border-color: rgba(24, 115, 63, 0.24);
  background: rgba(24, 115, 63, 0.08);
  color: #18733f;
}

.auth-server-error.is-error {
  border-color: rgba(199, 54, 47, 0.24);
  background: var(--auth-error-bg);
  color: var(--auth-error);
}

.auth-server-status-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1.3;
  margin-top: 1px;
}

.auth-server-status-text {
  flex: 1 1 auto;
}

.auth-link-row {
  display: flex;
  justify-content: flex-end;
  min-height: 24px;
  margin-top: -4px;
}

.auth-link-row a,
.auth-secondary-link a,
.auth-footer-links a,
.auth-checkbox-label a {
  color: var(--auth-red);
  text-decoration: none;
  transition:
    color 150ms ease,
    text-decoration-color 150ms ease;
}

.auth-link-row a:hover,
.auth-secondary-link a:hover,
.auth-footer-links a:hover,
.auth-checkbox-label a:hover {
  color: var(--auth-red-dark);
  text-decoration: underline;
}

.auth-checkbox-group {
  display: grid;
  gap: 12px;
}

.auth-checkbox {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.auth-checkbox input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--auth-red);
}

.auth-checkbox input:focus-visible {
  outline: 2px solid var(--auth-red);
  outline-offset: 2px;
}

.auth-checkbox-label {
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
}

.auth-password-rule-list {
  display: grid;
  gap: 2px;
  margin-top: 0;
}

.auth-password-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-muted);
}

.auth-password-rule::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.45;
}

.auth-password-rule.is-valid {
  color: #18733f;
}

.auth-password-rule.is-valid::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #18733f;
  opacity: 1;
  font-size: 0.75rem;
  font-weight: 700;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  margin-bottom: 16px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #e12512 0%, #c61809 100%);
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 1.55rem;
  font-weight: 600 !important;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  transition:
    background 120ms ease,
    color 150ms ease,
    transform 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.auth-submit:hover:not(:disabled),
.auth-submit:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, #c91f10 0%, #af1408 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  outline: none;
}

.auth-submit:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-submit:disabled {
  cursor: not-allowed;
  opacity: 1;
  background: #e5e7eb;
  color: #6b7280;
  box-shadow: none;
}

.auth-submit-label,
.auth-submit-loading {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.auth-submit-loading {
  display: none;
}

.auth-submit.is-loading .auth-submit-label {
  display: none;
}

.auth-submit.is-loading .auth-submit-loading {
  display: inline-flex;
}

.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: authSpin 700ms linear infinite;
}

.auth-secondary-link {
  margin-top: 2px;
  text-align: center;
  color: var(--auth-text);
  font-size: 0.98rem;
}

.auth-bottom {
  margin-top: 42px;
  text-align: center;
}

.auth-footer-links {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  justify-content: center;
  color: var(--auth-muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.auth-footer-links span {
  color: #9a9a9a;
}

.auth-hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      180deg,
      rgba(25, 25, 25, 0.12) 0%,
      rgba(25, 25, 25, 0.26) 100%
    ),
    linear-gradient(
      90deg,
      rgba(16, 16, 16, 0.12) 0%,
      rgba(16, 16, 16, 0.02) 34%
    );
}

.auth-hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-hero-card {
  position: relative;
  z-index: 1;
  margin: 22vh auto 0;
  width: min(88%, 380px);
  padding: 26px 28px;
  border-radius: 16px;
  background: rgba(65, 59, 52, 0.72);
  box-shadow: var(--auth-shadow);
  color: #ffffff;
  text-align: center;
  animation: authFadeInUp 260ms ease;
}

.auth-hero-copy {
  display: grid;
  gap: 10px;
  color: #ffffff;
  font-family: "Inter", sans-serif;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.35;
}

.auth-hero-copy p {
  margin: 0;
  color: #ffffff;
}

.auth-password-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 1.2rem;
  line-height: 1;
}

.auth-password-toggle[data-visible="true"] .auth-password-toggle-icon {
  opacity: 0.75;
}

@media (max-width: 991.98px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: 100vh;
  }

  .auth-hero {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .auth-panel {
    justify-content: flex-start;
    padding: 20px 16px 24px;
  }

  .auth-panel-inner {
    max-width: 420px;
  }

  .auth-brand {
    margin-bottom: 24px;
    justify-content: center;
  }

  .auth-brand a {
    justify-content: center;
  }

  .auth-brand-logo-desktop {
    display: none;
  }

  .auth-brand-logo-mobile {
    display: block;
    width: 126px;
  }

  .auth-heading {
    margin-bottom: 18px;
    text-align: center;
  }

  .auth-heading h1 {
    margin-bottom: 12px;
    font-size: 2.1rem;
  }

  .auth-heading p {
    font-size: 1rem;
  }

  .auth-form {
    gap: 12px;
  }

  .auth-link-row {
    justify-content: flex-start;
  }

  .auth-bottom {
    margin-top: 32px;
  }
}

@keyframes authFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes authFadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authSpin {
  to {
    transform: rotate(360deg);
  }
}
