/**
 * Plain-page atmosphere — soft backgrounds and illustration panels.
 * Keeps auth, legal, account, and error pages warm without competing with content.
 */

.bodyContainer:has(.plain-page),
.bodyContainer:has(.guest-page-wrap),
.bodyContainer:has(.error-page-wrap) {
  background:
    radial-gradient(ellipse 75% 45% at 100% 0%, rgba(212, 232, 212, 0.32) 0%, transparent 52%),
    radial-gradient(ellipse 55% 35% at 0% 100%, rgba(255, 235, 220, 0.42) 0%, transparent 48%),
    #fffaf5 !important;
}

/* Illustration sizing */
.page-illustration {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.page-illustration--photo {
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(92, 64, 51, 0.08);
}

.page-illustration--xs {
  max-width: 112px;
  margin-inline: auto;
}

.page-illustration--sm {
  max-width: 160px;
  margin-inline: auto;
}

.page-illustration--md {
  max-width: 100%;
  margin-inline: auto;
}

.page-illustration--lg {
  max-width: 280px;
  margin-inline: auto;
}

/* Photo — side panel fills the column */
.page-illustration-panel:has(.page-illustration--photo) {
  padding: 0;
  display: block;
  position: relative;
  min-height: 0;
  aspect-ratio: 4 / 3;
  background: #f0e6d8;
  align-items: stretch;
  justify-content: stretch;
}

.page-illustration-panel:has(.page-illustration--photo) .page-illustration--photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: none;
}

/* Photo — inline banner inside auth cards (mobile) */
.auth-shell .page-illustration--photo {
  width: 100%;
  max-width: none;
  aspect-ratio: 16 / 9;
  max-height: 200px;
  margin-inline: auto;
  margin-bottom: 1rem;
  border-radius: 12px;
}

.coming-soon-art {
  max-width: 200px !important;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Photo — empty states */
.meals-pg-empty .page-illustration--photo,
.rc-empty .page-illustration--photo,
.app-pg-empty .page-illustration--photo,
.pantry-pg-empty .page-illustration--photo,
.col-pg-empty .page-illustration--photo,
.choose-pg-empty .page-illustration--photo {
  width: min(260px, 84%);
  max-width: none;
  aspect-ratio: 4 / 3;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.07);
}

/* Photo — recipe add hub hero */
.recipe-hub-hero-photo.page-illustration--photo {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Photo — meal plan hub hero */
.plan-hero-photo.page-illustration--photo {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Photo — setup wizard hero (full-bleed within hero media) */
.setup-hero-photo.page-illustration--photo {
  width: 100%;
  max-width: none;
  height: 100%;
  aspect-ratio: auto;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Photo — setup wizard header (legacy) */
.setup-header-art.page-illustration--photo {
  width: min(280px, 100%);
  max-width: none;
  aspect-ratio: 16 / 9;
  max-height: 180px;
  margin: 0 auto 1rem;
}

/* Auth / contact side panel */
.page-illustration-panel {
  border-radius: 16px;
  overflow: hidden;
  min-height: 0;
  aspect-ratio: 4 / 3;
  background: #f0e6d8;
  border: 1px solid #ecd9c8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

/* Legal & account headers */
.plain-page {
  position: relative;
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding: 0.5rem 0 1.5rem;
}

.account-page.plain-page {
  max-width: var(--page-max-width);
}

.legal-pg-header,
.account-pg-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  margin-bottom: 1.15rem;
}

.legal-pg-header-text {
  min-width: 0;
}

.legal-pg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  color: var(--primary, #d96c3d);
  font-size: var(--text-xl);
  line-height: 1;
  flex-shrink: 0;
}

.legal-pg-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #3d2e1f;
  margin: 0 0 0.15rem;
}

.legal-pg-subtitle {
  font-size: 0.85rem;
  color: #6b5c4f;
  max-width: 32rem;
  margin: 0;
}

.legal-pg-card {
  background: #fff;
  border-radius: 10px;
  border-left: 4px solid #d96c3d;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(92, 64, 51, 0.05);
}

.legal-pg-card h2,
.legal-pg-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #3d2e1f;
  margin: 0 0 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-pg-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: #d96c3d;
}

.legal-pg-card p {
  font-size: 0.85rem;
  color: #6b5c4f;
  line-height: 1.6;
  margin: 0;
}

.legal-pg-card a:not(.btn):not([class*='-btn']) {
  color: #d96c3d;
  text-decoration: underline;
}

.legal-pg-card .btn,
.legal-pg-card a.btn,
.legal-pg-card button.btn,
.plain-page .btn-primary,
.plain-page a.btn-primary {
  color: #fff !important;
  text-decoration: none;
}

.legal-pg-footer {
  font-size: 0.8rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 1.25rem;
}

.legal-pg-footer a {
  color: #6b5c4f;
  text-decoration: none;
}

.legal-pg-footer a:hover {
  color: #d96c3d;
}

/* Error pages */
.error-page-wrap {
  padding: 1.25rem 0 2rem;
}

.error-page-art-mobile {
  text-align: center;
  margin-bottom: 1rem;
}

.error-page-art-mobile .page-illustration--photo {
  max-width: 140px;
  aspect-ratio: 4 / 3;
  margin-inline: auto;
  box-shadow: 0 4px 16px rgba(92, 64, 51, 0.08);
}

.error-page-card {
  background: #fff;
  border: 1px solid #ecd9c8;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  box-shadow: 0 8px 32px rgba(92, 64, 51, 0.08);
}

.error-page-code {
  font-size: clamp(2.25rem, 8vw, 3rem);
  font-weight: 800;
  color: #d96c3d;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #3d2e1f;
  margin-bottom: 0.65rem;
}

.error-page-desc {
  font-size: 0.92rem;
  color: #6b5c4f;
  margin-bottom: 1.25rem;
}

.error-page-meta {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 1.25rem;
  text-align: left;
}

.error-page-meta p {
  margin-bottom: 0.25rem;
}

.error-btn-outline {
  border: 1.5px solid #ecd9c8;
  color: #3d2e1f;
  background: #fff;
  border-radius: 10px;
  font-weight: 600;
}

.error-btn-outline:hover {
  border-color: #d96c3d;
  color: #d96c3d;
  background: #fff5eb;
}

.error-btn-primary {
  background: #d96c3d;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
}

.error-btn-primary:hover {
  background: #c45a2e;
  color: #fff;
}

@media (max-width: 768px) {
  .page-illustration-panel:has(.page-illustration--photo) {
    aspect-ratio: 4 / 3;
  }

  .setup-header-art.page-illustration--photo {
    max-height: 160px;
  }

  .meals-pg-empty .page-illustration--photo,
  .rc-empty .page-illustration--photo,
  .app-pg-empty .page-illustration--photo,
  .pantry-pg-empty .page-illustration--photo,
  .col-pg-empty .page-illustration--photo,
  .choose-pg-empty .page-illustration--photo {
    width: min(240px, 90%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-illustration-panel,
  .error-page-card {
    transition: none;
  }
}
