/* Split auth — registration (compact: fits typical laptop viewport without scroll) */
/**
 * Register loads only tokens + this file (no base.css), so we reset box model here:
 * without border-box, min-height: 100vh + padding becomes taller than the viewport → useless scroll.
 */
html {
  margin: 0;
  height: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}
*,
*::before,
*::after {
  box-sizing: inherit;
}

.page--register {
  margin: 0;
  /* vh fallback; svh/dvh avoid padding + vh rounding past one screen */
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.85rem;
}

.auth-shell {
  width: 100%;
  max-width: 1000px;
}

.auth-card {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--color-surface);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(var(--shadow-rgb), 0.1), 0 2px 8px rgba(var(--shadow-rgb), 0.05);
  overflow: hidden;
}

@media (min-width: 840px) {
  .auth-card {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-panel--form {
  padding: 1rem 1.15rem 0.85rem;
  display: flex;
  flex-direction: column;
}

@media (min-width: 840px) {
  .auth-panel--form {
    padding: 1.25rem 1.55rem 1rem;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.auth-brand__mark {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-brand-primary), var(--color-brand-strong));
  box-shadow: 0 2px 8px rgba(var(--rgb-brand), 0.35);
}

.auth-brand__text {
  font-weight: 700;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.auth-brand__text span {
  font-weight: 600;
  color: var(--color-brand-strong);
  margin-left: 0.25rem;
}

.auth-heading {
  font-size: 1.42rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.3rem;
  line-height: 1.2;
}

.auth-lead {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.38;
}

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

.auth-field-group {
  margin-bottom: 0.42rem;
  width: 100%;
}

.auth-form .form__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.18rem;
}

.auth-form .form__label .auth-label-hint {
  font-weight: 500;
  color: var(--color-text-muted);
}

.auth-form .form__input {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.93rem;
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form .form__input:focus {
  outline: none;
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(var(--rgb-brand), 0.2);
}

.auth-form .form__input::placeholder {
  color: color-mix(in srgb, var(--color-text-muted) 72%, var(--color-surface));
}

.auth-field-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.auth-field-wrap .form__input {
  padding-right: 2.75rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.auth-toggle-pw {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.35rem;
  cursor: pointer;
  color: var(--color-text-muted);
  border-radius: 6px;
  line-height: 0;
}

.auth-toggle-pw:hover {
  color: var(--color-text);
  background: color-mix(in srgb, var(--color-info-bg) 55%, var(--color-surface));
}

.auth-toggle-pw:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 2px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 520px) {
  .auth-form-grid--2col {
    grid-template-columns: 1fr 1fr;
    column-gap: 0.9rem;
    row-gap: 0.15rem;
  }
  .auth-form-grid__full {
    grid-column: 1 / -1;
  }
}

.auth-role-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 0.12rem;
}

.auth-role-option {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--color-text);
  user-select: none;
}

.auth-role-option input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--color-brand-strong);
}

.auth-legal {
  margin: 0.32rem 0 0;
  font-size: 0.72rem;
  line-height: 1.38;
  color: var(--color-text-muted);
}

.auth-legal a {
  color: var(--color-brand-strong);
  font-weight: 600;
  text-decoration: none;
}

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

.auth-link {
  color: var(--color-brand-strong);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: 0.42rem;
  padding: 0.58rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.96rem;
  color: #fff;
  background: linear-gradient(180deg, var(--color-brand-primary) 0%, var(--color-brand-strong) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(var(--rgb-brand), 0.32);
  transition: transform 0.12s, box-shadow 0.12s;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(var(--rgb-brand), 0.38);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 1.05rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.auth-btn-secondary:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-strong);
}

.auth-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

a.auth-submit {
  text-decoration: none;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  flex: 1 1 auto;
}

.auth-switch {
  text-align: center;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.84rem;
  color: var(--color-text-muted);
}

.auth-switch__line {
  margin: 0.18rem 0;
  line-height: 1.4;
}

.auth-switch__line .auth-link {
  margin-left: 0.15rem;
}

.auth-panel-footer {
  margin-top: auto;
  padding-top: 0.62rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.auth-panel-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.auth-panel-footer a:hover {
  color: var(--color-brand-primary);
  text-decoration: underline;
}

.auth-panel--hero {
  position: relative;
  padding: 1.1rem 1.25rem;
  background: var(--color-brand-strong);
  color: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

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

.auth-hero__pattern {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 100% 0%, rgba(255, 255, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 20% 90%, rgba(0, 0, 0, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.06) 0%, transparent 35%);
  pointer-events: none;
}

.auth-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  text-align: center;
}

.auth-hero__logo-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0 0 0.65rem;
}

.auth-hero__logo {
  display: block;
  width: auto;
  height: auto;
  max-height: min(10.5rem, 42vh);
  max-width: min(16rem, 94%);
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.2));
}

.auth-hero__title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.auth-hero__subtitle {
  margin: 0 auto 0.55rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
  max-width: 22rem;
  text-align: center;
}

.auth-hero__content .hero-mock {
  align-self: stretch;
  width: 100%;
  text-align: left;
}

.hero-mock {
  position: relative;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.5rem;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.hero-mock__kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.38rem;
  margin-bottom: 0.38rem;
}

.hero-mock__kpi {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 0.38rem 0.48rem;
}

.hero-mock__kpi-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-bottom: 0.2rem;
}

.hero-mock__kpi-value {
  font-size: 0.88rem;
  font-weight: 700;
}

.hero-mock__chart {
  height: 2.5rem;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.08) 100%);
  margin-bottom: 0.35rem;
  position: relative;
  overflow: hidden;
}

.hero-mock__chart::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.35rem;
  height: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.hero-mock__bars {
  position: absolute;
  bottom: 0.35rem;
  left: 0.35rem;
  right: 0.35rem;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 1.4rem;
}

.hero-mock__bar {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px 2px 0 0;
  min-height: 15%;
}

.hero-mock__bar:nth-child(1) { height: 45%; }
.hero-mock__bar:nth-child(2) { height: 70%; }
.hero-mock__bar:nth-child(3) { height: 55%; }
.hero-mock__bar:nth-child(4) { height: 90%; }
.hero-mock__bar:nth-child(5) { height: 60%; }
.hero-mock__bar:nth-child(6) { height: 40%; }

.hero-mock__table {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.hero-mock__row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.hero-mock__cell {
  height: 0.32rem;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.35);
}

.hero-mock__cell--w40 { width: 40%; }
.hero-mock__cell--w25 { width: 25%; }
.hero-mock__cell--w20 { width: 20%; }

.page--register .alert {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  line-height: 1.38;
}

.page--register .alert--error {
  margin-bottom: 0.45rem;
  background: var(--color-alert-error-bg);
  color: var(--color-error);
  border: 1px solid var(--color-alert-error-border);
}

.page--register .alert--success {
  margin-bottom: 0.45rem;
  background: #edf6f0;
  color: #1e4d2a;
  border: 1px solid #b5d9c4;
}

.auth-success-lead {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.42;
}

/* Short viewport: avoid vertical centering eating space */
@media (max-height: 820px) {
  .page--register {
    align-items: flex-start;
    padding-top: 0.25rem;
  }
}
