/* ==========================================================================
   Auth (Login) page
   ========================================================================== */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 0.96fr) minmax(520px, 1.04fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(20px, 3vw, 36px);
  background: #fff;
}

/* ---- Left branding panel ---- */
.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: calc(100vh - clamp(40px, 6vw, 72px));
  padding: clamp(24px, 3vw, 40px);
  background: #050505;
  color: #fff;
  border-radius: 18px;
  overflow: hidden;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.auth-brand__logo {
  display: block;
  width: min(280px, 100%);
  height: auto;
}

.auth-brand__mark {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary-dark);
  flex-shrink: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.auth-brand__mark--image {
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(198, 154, 109, 0.34);
}

.auth-brand__mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand__mark .icon {
  width: 24px;
  height: 24px;
}

.auth-brand__text,
.auth-mobile-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.auth-brand__name {
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: #fff;
}

.auth-brand__tag {
  font-size: var(--fs-xs);
  color: var(--color-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-brand-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  max-width: none;
  margin: 0;
}

.auth-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--color-secondary) 0%, #f6ede2 40%, var(--color-primary) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  padding: clamp(18px, 3vw, 44px);
}

.auth-preview__screen {
  display: grid;
  grid-template-columns: minmax(72px, 0.22fr) 1fr;
  height: 100%;
  background: rgba(6, 6, 8, 0.92);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.auth-preview__sidebar {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px 14px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-preview__sidebar span {
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.auth-preview__sidebar span:first-child {
  width: 70%;
  background: rgba(198, 154, 109, 0.9);
}

.auth-preview__dashboard {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 14px;
  padding: 18px;
  min-width: 0;
}

.auth-preview__chart,
.auth-preview__code,
.auth-preview__rows {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
}

.auth-preview__chart {
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 16px;
}

.auth-preview__chart span {
  flex: 1;
  min-height: 24%;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--color-secondary), var(--color-secondary-dark));
}

.auth-preview__chart span:nth-child(2) { height: 72%; }
.auth-preview__chart span:nth-child(3) { height: 48%; }
.auth-preview__chart span:nth-child(4) { height: 88%; }

.auth-preview__code,
.auth-preview__rows {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
}

.auth-preview__code span,
.auth-preview__rows span {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.auth-preview__code span:nth-child(odd) {
  width: 78%;
}

.auth-preview__rows {
  grid-column: 1 / -1;
}

.auth-preview__rows span:nth-child(1) { width: 92%; }
.auth-preview__rows span:nth-child(2) { width: 74%; }
.auth-preview__rows span:nth-child(3) { width: 84%; }

.auth-brand-copy {
  margin-top: clamp(28px, 5vw, 54px);
  max-width: 650px;
}

.auth-brand-copy span {
  display: block;
  margin-bottom: var(--space-3);
  color: rgba(255, 255, 255, 0.68);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.auth-brand-copy h1 {
  margin: 0 0 var(--space-4);
  color: #fff;
  /* Sized so the headline stays on one line; the brand panel is hidden below
     1080px, so nowrap cannot overflow on small screens. */
  font-size: clamp(1.75rem, 3.2vw, 3.1rem);
  line-height: 1.08;
  font-weight: var(--fw-bold);
  letter-spacing: 0;
  white-space: nowrap;
}

.auth-brand-copy p {
  max-width: 720px;
  margin-bottom: var(--space-4);
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.45;
}

.auth-learn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 4px;
  background: #171717;
  color: #fff;
  font-weight: var(--fw-semibold);
}

.auth-learn-link:hover {
  background: #242424;
  color: #fff;
}

.auth-panel-controls {
  position: absolute;
  right: clamp(24px, 3vw, 40px);
  bottom: clamp(24px, 3vw, 40px);
  display: flex;
  gap: var(--space-2);
}

.auth-panel-controls span {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.22);
  color: #050505;
}

.auth-panel-controls span:first-child {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.58);
}

/* ---- Right form panel ---- */
.auth-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - clamp(40px, 6vw, 72px));
  padding: clamp(24px, 5vw, 72px);
  background: #fff;
}

.auth-form-card {
  width: min(100%, 500px);
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 4vw, 42px);
}

.auth-mobile-brand {
  display: none;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.auth-mobile-brand .auth-brand__mark {
  box-shadow: none;
}

.auth-mobile-brand .auth-brand__name {
  color: var(--color-text);
}

.auth-mobile-brand .auth-brand__tag {
  color: var(--color-secondary-dark);
}

.auth-form-head {
  margin-bottom: var(--space-5);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-full);
  background: var(--color-secondary-light);
  color: var(--color-primary-dark);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-3);
}

.auth-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
}

.auth-form-card h1 {
  margin-bottom: var(--space-1);
  font-size: clamp(2rem, 5vw, 2.65rem);
  line-height: 1.08;
}

.auth-form-card > p,
.auth-form-head p {
  color: var(--color-text-muted);
  font-size: var(--fs-base);
}

.auth-form-card .form-group {
  margin-bottom: var(--space-3);
}

.auth-form-card .form-label {
  margin-bottom: var(--space-2);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
}

.auth-form-card .form-control {
  min-height: 54px;
  border-color: var(--color-border-strong);
  background: var(--color-card);
  font-size: var(--fs-base);
}

.auth-form-card .form-control:focus {
  background: #fff;
}

.auth-form-card .input-icon .icon,
.auth-password-field .icon-lead {
  color: var(--color-text-muted);
}

/* Match the password field's icon metrics: the shared .input-icon style is
   tuned for 42px controls, but auth inputs are 54px tall. */
.auth-form-card .input-icon {
  display: flex;
  align-items: center;
}

.auth-form-card .input-icon > [data-icon] {
  position: absolute;
  left: 15px;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}

.auth-form-card .input-icon .icon {
  position: static;
  transform: none;
  display: block;
}

.auth-form-card .input-icon .form-control {
  padding-left: 46px;
}

.auth-password-field {
  position: relative;
}

.auth-password-field .form-control {
  padding-left: 46px;
  padding-right: 50px;
}

.auth-password-field .icon-lead {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
}

.auth-password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  color: var(--color-text);
  background: var(--color-bg);
}

.auth-form-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-2) 0 var(--space-4);
}

.auth-form-row-between .form-check {
  font-weight: var(--fw-medium);
}

.auth-forgot-link {
  color: var(--color-secondary-dark);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}

.auth-forgot-link:hover {
  color: var(--color-primary);
}

#login-submit-btn {
  min-height: 56px;
  font-size: var(--fs-md);
}

.auth-form-footer {
  margin-top: var(--space-5);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--fs-xs);
}

.auth-error {
  display: none;
  margin-bottom: var(--space-3);
}

.auth-error.visible {
  display: flex;
}

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

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    padding: var(--space-4);
  }

  .auth-mobile-brand {
    display: flex;
  }
}

@media (max-width: 560px) {
  .auth-form-card {
    padding: var(--space-4);
    box-shadow: var(--shadow-md);
  }

  .auth-form-row-between {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-forgot-link {
    white-space: normal;
  }
}
