/* ==========================================================================
   Auth Shell - top-level shell assembly for the future DS rebuild
   ========================================================================== */

:root {
  --rebuild-page: var(--bg);
  --rebuild-ink: var(--text);
  --rebuild-muted: var(--helper);
  --rebuild-border: var(--border);
  --rebuild-surface: var(--surface);
  --rebuild-accent: var(--success-note-accent);
  --rebuild-accent-soft: rgba(0, 163, 136, 0.12);
  --rebuild-warning: var(--warning-note-accent);
  --rebuild-frame-max: 1280px;
  --rebuild-frame-pad: 1.5rem;
  --rebuild-frame-pad-tablet: 1.25rem;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--rebuild-ink);
  background: var(--rebuild-page);
  font-family: var(--font);
  line-height: 1.5;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

/*
  Auth Shell owns shell regions and state visibility only.

  It must not style Header, Sidebar, Workspace Layout, Footer, Modals,
  project content, verification form controls, or builder content internals.
*/

.as-shell {
  min-height: 100vh;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  color: var(--text-primary, #f2eee8);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0) 280px),
    var(--app-bg, #111314);
}

.as-shell__surface,
.as-shell__app {
  min-width: 0;
}

.as-shell__surface {
  min-height: 100vh;
  display: none;
}

.as-shell__surface--public,
.as-shell__surface--verification {
  place-items: stretch;
}

.as-shell__app {
  min-height: 100vh;
  display: none;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.as-shell__header-slot,
.as-shell__footer-slot,
.as-shell__workspace-host,
.as-shell__sidebar-slot {
  min-width: 0;
}

.as-shell__frame {
  width: min(var(--rebuild-frame-max), calc(100% - (var(--rebuild-frame-pad) * 2)));
  margin-inline: auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.as-shell__sidebar-slot {
  min-height: 0;
}

.as-shell__workspace-host {
  min-height: 0;
  isolation: isolate;
}

.as-shell--builder .as-shell__frame {
  padding-block: var(--space-2) var(--space-5);
}

.as-shell--projects .as-shell__frame {
  grid-template-columns: auto minmax(0, 1fr);
  padding-block: var(--space-2) var(--space-5);
}

.as-shell--projects .as-shell__sidebar-slot {
  display: block;
  position: sticky;
  top: var(--space-2);
  align-self: start;
}

.as-shell--builder .as-shell__sidebar-slot {
  position: sticky;
  top: var(--space-2);
  align-self: start;
}

.as-shell__workspace-host:focus {
  outline: none;
}

.as-shell__workspace-host:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.as-shell__placeholder {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6, 24px);
  color: var(--helper-text, #a9b6bd);
  font-family: var(--font, "DM Sans", sans-serif);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.as-shell--public .as-shell__surface--public,
.as-shell--signed-out .as-shell__surface--public,
.as-shell--expired .as-shell__surface--public {
  display: grid;
}

.as-shell--verification .as-shell__surface--verification {
  display: grid;
}

.as-shell--projects .as-shell__app,
.as-shell--builder .as-shell__app {
  display: grid;
}

.as-shell--projects .as-shell__sidebar-slot {
  display: block;
  position: sticky;
  top: var(--space-2);
  align-self: start;
}

.as-shell--projects .as-shell__frame {
  grid-template-columns: auto minmax(0, 1fr);
}

.as-shell--restoring .as-shell__placeholder {
  display: grid;
}

@media (max-width: 860px) {
  .as-shell__frame {
    width: min(100% - 2rem, var(--rebuild-frame-max));
    grid-template-columns: minmax(0, 1fr);
  }

  .as-shell__sidebar-slot {
    display: none;
  }
}
