/* Client auth & account area */
.auth-page {
  min-height: calc(100vh - var(--header-h));
  padding: calc(var(--header-h) + 2.5rem) 0 4rem;
  background: var(--gradient-page-hero);
  position: relative;
}

.auth-page:before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 10% 20%, rgba(37, 99, 235, 0.1), transparent 55%),
    radial-gradient(ellipse 40% 35% at 90% 80%, rgba(249, 115, 22, 0.08), transparent 50%);
  pointer-events: none;
}

.auth-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0;
  max-width: 980px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.auth-aside {
  padding: clamp(2rem, 4vw, 2.75rem);
  background: linear-gradient(160deg, #0f172a 0%, #1e3a8a 55%, #172554 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
}

.auth-aside:after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(249, 115, 22, 0.28), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(59, 130, 246, 0.2), transparent 50%);
  pointer-events: none;
}

.auth-aside > * {
  position: relative;
  z-index: 1;
}

.auth-aside-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.auth-aside-brand img {
  height: 36px;
  width: auto;
  filter: brightness(0) invert(1);
}

.auth-aside h2 {
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 1.5rem 0 0.75rem;
}

.auth-aside p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.95rem;
  line-height: 1.65;
}

.auth-aside-list {
  margin-top: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
}

.auth-aside-list li:before {
  content: "✓";
  color: var(--orange);
  font-weight: 800;
  flex-shrink: 0;
}

.auth-aside-foot {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}

.auth-panel {
  padding: clamp(2rem, 4vw, 2.75rem);
}

.auth-panel-head {
  margin-bottom: 1.75rem;
}

.auth-panel-head .section-label {
  margin-bottom: 0.5rem;
}

.auth-panel-head h1 {
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  color: var(--blue-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.auth-panel-head p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.auth-form .field {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 0.4rem;
}

.auth-form input,
.auth-form select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: var(--off-white);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.auth-form input:focus,
.auth-form select:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.auth-form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0.25rem 0 1.25rem;
  font-size: 0.88rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.auth-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
}

.auth-form-meta a {
  color: var(--orange);
  font-weight: 600;
}

.auth-form-meta a:hover {
  color: var(--orange-dark);
}

.auth-form .btn {
  width: 100%;
  margin-top: 0.25rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.35rem 0;
  color: var(--text-light);
  font-size: 0.8rem;
}

.auth-divider:before,
.auth-divider:after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
}

.auth-switch a {
  color: var(--blue);
  font-weight: 700;
}

.auth-switch a:hover {
  color: var(--orange);
}

.auth-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--blue-soft);
  border: 1px solid var(--blue-mid);
  font-size: 0.82rem;
  color: var(--blue-dark);
  line-height: 1.5;
}

/* Account dashboard */
.account-page {
  padding: calc(var(--header-h) + 2rem) 0 4rem;
  background: var(--off-white);
  min-height: calc(100vh - var(--header-h));
}

.account-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.account-top h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--blue-dark);
  letter-spacing: -0.02em;
}

.account-top p {
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.account-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.account-nav {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.75rem;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: calc(var(--header-h) + 1rem);
}

.account-nav button,
.account-nav a {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.65rem;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  transition: var(--transition);
}

.account-nav button:hover,
.account-nav a:hover,
.account-nav button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.account-nav .logout-btn {
  color: #b91c1c;
  margin-top: 0.35rem;
}

.account-nav .logout-btn:hover {
  background: #fef2f2;
  color: #991b1b;
}

.account-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.account-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.account-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin-bottom: 0.35rem;
}

.account-card > p.muted {
  color: var(--text-light);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.account-stat {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.account-stat strong {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.02em;
}

.account-stat span {
  font-size: 0.8rem;
  color: var(--text-light);
}

.service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.service-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-row:first-child {
  padding-top: 0;
}

.service-row h3 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.service-row p {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-warn {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.account-empty {
  text-align: center;
  padding: 2rem 1rem;
}

.account-empty p {
  color: var(--text-muted);
  margin: 0.75rem 0 1.25rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.profile-item {
  padding: 0.9rem 1rem;
  background: var(--off-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.profile-item span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.profile-item strong {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
  word-break: break-word;
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-aside {
    display: none;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }

  .account-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .account-nav button,
  .account-nav a {
    width: auto;
    flex: 1 1 auto;
    justify-content: center;
  }

  .account-stats,
  .profile-grid,
  .auth-form-row {
    grid-template-columns: 1fr;
  }
}
