/* Account pages — split layout (login / register) */

.auth-page {
  --auth-primary: var(--color-brand-red);
  --auth-primary-hover: var(--color-brand-red-bright);
  --auth-primary-active: var(--color-brand-red-deep);
  --auth-primary-light: #fef2f2;
  --auth-primary-ring: rgba(161, 2, 2, 0.12);
  --auth-text: var(--color-brand-night);
  --auth-text-muted: var(--color-brand-slate);
  --auth-border: var(--color-brand-ash);
  --auth-panel-bg: #ffffff;
  --auth-night: var(--color-brand-night);
  --auth-form-padding-x: 1.25rem;
  --auth-form-padding-y: 1.75rem;
  --auth-mobile-top-gap: 1.5rem;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--auth-panel-bg);
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Mobile-only branded header (desktop uses the side visual panel) */
.auth-mobile-hero {
  display: block;
  position: relative;
  flex-shrink: 0;
  min-height: 10.5rem;
  padding: max(1.5rem, env(safe-area-inset-top, 0px)) var(--auth-form-padding-x) 2.25rem;
  padding-left: max(var(--auth-form-padding-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--auth-form-padding-x), env(safe-area-inset-right, 0px));
  overflow: hidden;
  color: #fff;
}

.auth-mobile-hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/images/ligi-stadium.png');
  background-size: cover;
  background-position: center;
}

.auth-mobile-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(161, 2, 2, 0.88) 0%, rgba(30, 58, 95, 0.92) 100%);
}

.auth-mobile-hero-content {
  position: relative;
  z-index: 1;
  max-width: 24rem;
}

.auth-mobile-hero-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
}

.auth-mobile-hero-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.auth-page .auth-panel-form {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin-top: -1.25rem;
  border-radius: 1.25rem 1.25rem 0 0;
  background: #fff;
  box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.08);
  padding: calc(var(--auth-mobile-top-gap) + var(--auth-form-padding-y)) var(--auth-form-padding-x)
    var(--auth-form-padding-y);
  padding-top: calc(
    max(var(--auth-mobile-top-gap), env(safe-area-inset-top, 0px)) + var(--auth-form-padding-y)
  );
  padding-bottom: max(var(--auth-form-padding-y), env(safe-area-inset-bottom, 0px));
  padding-left: max(var(--auth-form-padding-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--auth-form-padding-x), env(safe-area-inset-right, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.auth-panel-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 576px) {
  .auth-page {
    --auth-form-padding-x: 1.5rem;
    --auth-form-padding-y: 2rem;
  }
}

@media (min-width: 992px) {
  .auth-page {
    flex-direction: row;
    background: #fff;
    --auth-form-padding-x: 3rem;
    --auth-form-padding-y: 2.5rem;
  }

  .auth-mobile-hero {
    display: none;
  }

  .auth-page .auth-panel-form {
    flex: 0 0 42%;
    max-width: 520px;
    min-width: 320px;
    justify-content: flex-start;
    margin-top: 0;
    border-radius: 0;
    box-shadow: none;
    padding: var(--auth-form-padding-y) var(--auth-form-padding-x);
    padding-top: var(--auth-form-padding-y);
    padding-bottom: var(--auth-form-padding-y);
    padding-left: var(--auth-form-padding-x);
    padding-right: var(--auth-form-padding-x);
    overflow-y: auto;
    max-height: 100vh;
    max-height: 100dvh;
  }

  .auth-page--wide .auth-panel-form {
    flex: 0 0 50%;
    max-width: 600px;
  }

  .auth-page--wide .auth-panel-body {
    justify-content: flex-start;
    padding-top: 0.5rem;
    padding-bottom: 1rem;
  }
}

.auth-page .auth-panel-visual {
  flex: 1;
  position: relative;
  display: none;
  background: var(--auth-night);
  overflow: hidden;
  border-left: 6px solid var(--auth-primary);
}

@media (min-width: 992px) {
  .auth-page .auth-panel-visual {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.auth-page .auth-visual-bg {
  position: absolute;
  inset: 0;
  background-image: url('/images/ligi-stadium.png');
  background-size: cover;
  background-position: center;
  opacity: 0.35;
}

.auth-page .auth-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 41, 59, 0.88) 100%);
}

.auth-page .auth-visual-content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  padding: 2rem;
  color: #fff;
  text-align: center;
}

.auth-page .auth-visual-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.auth-page .auth-visual-content p {
  font-size: 1rem;
  opacity: 0.92;
  margin: 0;
}

.auth-brand img,
.auth-brand-logo {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 34px;
}

@media (min-width: 576px) {
  .auth-brand img,
  .auth-brand-logo {
    max-height: 36px;
  }
}

.auth-headline {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--auth-text);
  line-height: 1.3;
  margin: 1rem 0 0.35rem;
  word-wrap: break-word;
}

@media (min-width: 576px) {
  .auth-headline {
    font-size: 1.375rem;
    margin-top: 1.25rem;
  }
}

@media (min-width: 992px) {
  .auth-headline {
    font-size: 1.5rem;
    margin-top: 1.5rem;
  }
}

.auth-subheadline {
  color: var(--auth-text-muted);
  font-size: 0.875rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

@media (min-width: 992px) {
  .auth-subheadline {
    font-size: 0.9375rem;
    margin-bottom: 1.75rem;
  }
}

.auth-form .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--auth-text);
  margin-bottom: 0.35rem;
}

.auth-form .form-control,
.auth-form .form-select {
  min-height: 2.75rem;
  border: 1px solid var(--auth-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 1rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 992px) {
  .auth-form .form-control,
  .auth-form .form-select {
    font-size: 0.9375rem;
  }
}

.auth-form .form-control:focus,
.auth-form .form-select:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 0.2rem var(--auth-primary-ring);
}

.auth-form .auth-password-wrap {
  position: relative;
}

.auth-form .auth-password-wrap .form-control {
  padding-right: 2.75rem;
}

.auth-form .auth-password-toggle {
  position: absolute;
  right: 0;
  top: 0;
  height: 2.75rem;
  width: 2.75rem;
  border: none;
  background: transparent;
  color: var(--auth-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.auth-btn-primary {
  min-height: 2.75rem;
  background: var(--auth-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
  width: 100%;
}

.auth-btn-primary:hover:not(:disabled) {
  background: var(--auth-primary-hover);
  color: #fff;
}

.auth-btn-primary:disabled {
  opacity: 0.65;
}

.auth-btn-outline {
  min-height: 2.75rem;
  background: #fff;
  border: 1px solid var(--auth-primary);
  color: var(--auth-primary);
  font-weight: 600;
  border-radius: 0.5rem;
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-btn-outline:hover {
  background: var(--auth-primary-light);
  color: var(--auth-primary);
}

.auth-action-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-result-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.auth-result-icon--success {
  color: #16a34a;
}

.auth-result-icon--error {
  color: var(--auth-primary);
}

.auth-link {
  color: var(--auth-primary);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.875rem;
}

.auth-link:hover {
  text-decoration: underline;
  color: var(--auth-primary-hover);
}

.auth-row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
}

@media (max-width: 399.98px) {
  .auth-row-between {
    flex-direction: column;
    align-items: flex-start;
  }
}

.auth-divider {
  text-align: center;
  color: var(--auth-text-muted);
  font-size: 0.8125rem;
  margin: 1.25rem 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--auth-border);
}

.auth-divider::before {
  left: 0;
}

.auth-divider::after {
  right: 0;
}

.auth-external-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.auth-external-btns .btn {
  font-size: 0.8125rem;
  color: var(--auth-primary);
  border-color: var(--auth-border);
  flex: 1 1 auto;
  min-width: min(100%, 8rem);
}

@media (max-width: 575.98px) {
  .auth-external-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-external-btns .btn {
    width: 100%;
    min-width: 0;
  }
}

.auth-profile-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 576px) {
  .auth-profile-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.auth-profile-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--auth-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  height: 100%;
}

.auth-profile-card:hover {
  border-color: var(--auth-primary);
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.08);
  transform: translateY(-2px);
  color: inherit;
}

.auth-profile-card .auth-profile-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: var(--auth-primary-light);
  color: var(--auth-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.auth-profile-card .auth-profile-icon .material-symbols-outlined {
  font-size: 1.35rem;
}

.auth-profile-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--auth-text);
}

.auth-profile-card p {
  font-size: 0.8125rem;
  color: var(--auth-text-muted);
  margin: 0 0 1rem;
  flex: 1;
  line-height: 1.45;
}

.auth-profile-card .auth-card-action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--auth-primary);
}

.auth-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--auth-text);
  margin: 1.5rem 0 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--auth-border);
}

.auth-section-title:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--auth-text-muted);
  text-decoration: none;
  margin-bottom: 1rem;
}

.auth-back-link:hover {
  color: var(--auth-primary);
}

body.auth-body,
body.admin-body.auth-body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  font-family: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
}

.auth-form .row {
  margin-left: 0;
  margin-right: 0;
}

.auth-form .row > [class*='col-'] {
  min-width: 0;
}

.auth-page .auth-brand {
  flex-shrink: 0;
}

.auth-footer {
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 1.5rem;
  text-align: center;
  color: var(--auth-text-muted);
  font-size: 0.6875rem; /* 11px — 2px smaller than previous 13px */
  line-height: 1.2;
  border-top: 1px solid var(--auth-border);
}

.auth-footer-line {
  margin: 0;
  line-height: 1.2;
}

.auth-footer-line + .auth-footer-line {
  margin-top: 0.0625rem;
}

/* Auth page enter animations */
@keyframes authFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-panel-body {
  animation: authFadeUp 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.auth-mobile-hero-content {
  animation: authFadeUp 500ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel-body,
  .auth-mobile-hero-content {
    animation: none !important;
  }
}
