:root {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #172033;
  background: #f6f7fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

.landing {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: radial-gradient(circle at top right, #dbeafe, transparent 45%), #f6f7fb;
}

.landing-card {
  width: min(520px, 100%);
  padding: 38px;
  background: #fff;
  border: 1px solid #dfe3ee;
  border-radius: 18px;
  box-shadow: 0 15px 40px #1f293718;
}

.auth-page {
  color: #f4f4f5;
  background: #111014;
}

.auth-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 43%) 1fr;
}

.auth-panel {
  display: grid;
  padding: 40px;
  place-items: center;
  background: #111014;
}

.auth-card {
  width: min(390px, 100%);
  padding: 42px;
  background: #17161b;
  border: 1px solid #302e38;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 30%);
}

.auth-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  color: #d7c1ff;
  font-size: 1.5rem;
  place-items: center;
  background: #29223b;
  border: 1px solid #5b4a80;
  border-radius: 50%;
}

.auth-kicker {
  color: #c4b5fd;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 10px 0 8px;
  color: #fff;
  font-size: 2rem;
  line-height: 1.1;
}

.auth-intro {
  margin: 0;
  color: #aaa7b2;
  line-height: 1.55;
}

.auth-form {
  margin-top: 30px;
}

.auth-form label {
  color: #e4e1e8;
}

.auth-form input {
  color: #fff;
  background: #100f13;
  border-color: #3a3742;
}

.auth-form input:focus {
  outline: 2px solid #a78bfa;
  outline-offset: 1px;
}

.auth-form .button {
  width: 100%;
  background: #7c5ce0;
}

.auth-form .button:hover {
  background: #8b6cf0;
}

.auth-back {
  display: inline-block;
  margin-top: 22px;
  color: #b9b4c4;
  font-size: 0.9rem;
}

.auth-image {
  min-height: 100%;
  background-image: linear-gradient(120deg, rgb(14 14 18 / 18%), rgb(14 14 18 / 2%)), url('../assets/login-panel.jpg');
  background-position: center;
  background-size: cover;
}

.eyebrow {
  color: #4f46e5;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.landing h1,
.workspace h1 {
  margin: 0.45rem 0 1rem;
  line-height: 1.15;
}

.landing p,
.workspace p {
  color: #526072;
  line-height: 1.6;
}

.button {
  display: inline-block;
  padding: 11px 17px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  background: #4f46e5;
  border: 0;
  border-radius: 9px;
}

.button.secondary {
  color: #4f46e5;
  background: #fff;
  border: 1px solid #a5b4fc;
}

.small {
  display: block;
  margin-top: 20px;
  color: #64748b;
  font-size: 0.9rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.dashboard-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid #d8deee;
  border-radius: 10px;
  background: #fff;
}

.dashboard-card .small {
  margin: 0;
}

.dashboard-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dashboard-metrics span {
  padding: 4px 8px;
  color: #3f4b61;
  font-size: 0.82rem;
  font-weight: 650;
  background: #eef1f8;
  border-radius: 999px;
}

.form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 650;
}

.form input,
.form select,
.form textarea {
  padding: 10px;
  font: inherit;
  border: 1px solid #bec6d5;
  border-radius: 8px;
}

.form textarea {
  min-height: 100px;
  resize: vertical;
}

.error {
  margin: 0;
  color: #b42318;
}

.bar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 62px;
  padding: 0 max(24px, calc((100vw - 960px) / 2));
  font-weight: 700;
  background: #fff;
  border-bottom: 1px solid #dfe3ee;
}

.bar a {
  color: #172033;
  text-decoration: none;
}

.bar span {
  margin-left: auto;
  color: #526072;
  font-size: 0.9rem;
  font-weight: 500;
}

.text-button {
  padding: 0;
  color: #4f46e5;
  font: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}

.workspace {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 48px 24px;
}

.site-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.site {
  padding: 16px;
  background: #fff;
  border: 1px solid #dfe3ee;
  border-radius: 12px;
}

.site strong,
.site span {
  display: block;
}

.site span {
  margin-top: 4px;
  color: #64748b;
  font-size: 0.9rem;
}

.panel {
  padding: 20px;
  margin-top: 24px;
  background: #fff;
  border: 1px solid #dfe3ee;
  border-radius: 12px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.compact .button {
  height: 42px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.candidate {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.candidate:first-child {
  padding-top: 0;
  margin-top: 8px;
  border-top: 0;
}

.candidate p {
  margin: 7px 0;
  font-size: 0.9rem;
}

.candidate .context {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8rem;
}

.page-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  padding-bottom: 8px;
  margin-top: 20px;
  border-bottom: 1px solid #dfe3ee;
}

.page-bulk-controls {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid #d8deee;
  border-radius: 10px;
  background: #f8f9ff;
}

.page-bulk-controls summary {
  cursor: pointer;
  font-weight: 700;
}

.page-bulk-controls .small {
  display: block;
  margin: 10px 0;
}

.page-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
  max-height: 290px;
  margin-top: 12px;
  overflow: auto;
}

.page-checkbox {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid #d8deee;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.page-tab {
  padding: 8px 12px;
  color: #475569;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid #dfe3ee;
  border-radius: 8px;
}

.page-tab:hover,
.page-tab:focus-visible {
  color: #4338ca;
  border-color: #a5b4fc;
  outline: none;
}

.page-tab.selected {
  color: #fff;
  background: #4f46e5;
  border-color: #4f46e5;
}

.page-review {
  margin-top: 16px;
}

.visual-editor {
  margin-top: 16px;
}

.visual-editor h2 {
  margin-bottom: 4px;
}

.modified-line {
  padding: 10px 12px;
  color: #334155;
  font-size: 0.9rem;
  background: #f8fafc;
  border-left: 3px solid #4f46e5;
}

.page-preview {
  width: 100%;
  min-height: 760px;
  margin-top: 12px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.78);
}

.preview-overlay-panel {
  display: flex;
  flex-direction: column;
  width: min(1500px, 100%);
  height: min(100%, 1000px);
  overflow: hidden;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 80px rgba(15, 23, 42, 0.45);
}

.preview-overlay-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #dfe3ee;
}

.preview-size-controls {
  display: flex;
  gap: 12px;
  margin-right: auto;
}

.preview-overlay .page-preview {
  flex: 1;
  width: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
}

.preview-overlay .page-preview.preview-tablet {
  align-self: center;
  flex: 0 1 auto;
  width: 820px;
  height: 100%;
  border-right: 1px solid #dfe3ee;
  border-left: 1px solid #dfe3ee;
}

.preview-overlay .page-preview.preview-mobile {
  align-self: center;
  flex: 0 1 auto;
  width: 420px;
  height: 100%;
  border-right: 1px solid #dfe3ee;
  border-left: 1px solid #dfe3ee;
}

@media (max-width: 640px) {
  .preview-overlay {
    padding: 0;
  }

  .preview-overlay-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
}

.selected-fields {
  margin-top: 20px;
}

.save-area {
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid #dfe3ee;
}

.save-area p {
  max-width: 68ch;
  color: #475569;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  color: #5b21b6;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #ede9fe;
  border-radius: 999px;
}

.badge.approved {
  color: #166534;
  background: #dcfce7;
}

.badge.ignored {
  color: #475569;
  background: #f1f5f9;
}

.editor-field {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.editor-field:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.editor-field label {
  display: grid;
  gap: 7px;
  font-weight: 650;
}

.editor-field textarea {
  width: 100%;
  min-height: 280px;
  height: 280px;
  padding: 16px;
  color: #edf1fb;
  font: 1.08rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: #111722;
  border: 1px solid #4a5670;
  border-radius: 10px;
  resize: none;
}

.editor-field textarea:focus {
  border-color: #9c8cff;
  outline: 2px solid rgb(156 140 255 / 30%);
}

.editor-status {
  min-height: 1.25rem;
  margin: 8px 0 0;
  color: #526072;
  font-size: 0.9rem;
}

.site ul {
  padding-left: 20px;
  margin: 10px 0 0;
  color: #526072;
  font-size: 0.9rem;
}

@media (max-width: 720px) {
  .auth-layout {
    display: block;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 24px;
  }

  .auth-card {
    padding: 32px 26px;
  }

  .auth-image {
    display: none;
  }

  .compact {
    grid-template-columns: 1fr;
  }
}

/* Portal dark theme. Website previews remain unchanged so they show the real site. */
:root {
  color: #e8edf7;
  color-scheme: dark;
  background: #10131b;
}

body {
  background: #10131b;
}

.landing {
  background: radial-gradient(circle at top right, #262151, transparent 44%), #10131b;
}

.landing-card,
.panel,
.site,
.dashboard-card,
.page-checkbox {
  background: #191e2a;
  border-color: #30394b;
  box-shadow: none;
}

.landing h1,
.workspace h1,
.panel h2,
.site strong,
.dashboard-card strong,
.bar a {
  color: #f6f8ff;
}

.landing p,
.workspace p,
.small,
.site span,
.bar span,
.save-area p,
.editor-status,
.site ul {
  color: #aeb9cc;
}

.eyebrow,
.text-button {
  color: #a99cff;
}

.button {
  background: #7461e8;
}

.button:hover,
.auth-form .button:hover {
  background: #8c7df2;
}

.button.secondary {
  color: #c9c1ff;
  background: #202738;
  border-color: #6259a6;
}

.form input,
.form select,
.form textarea {
  color: #edf1fb;
  background: #111722;
  border-color: #3e485d;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: #9c8cff;
  outline: 2px solid rgb(156 140 255 / 30%);
}

.form label,
.editor-field,
.page-bulk-controls summary {
  color: #e8edf7;
}

.bar {
  background: #151a24;
  border-color: #30394b;
}

.dashboard-metrics span {
  color: #c9d2e5;
  background: #242c3c;
}

.candidate,
.editor-field,
.save-area,
.page-tabs {
  border-color: #30394b;
}

.page-bulk-controls,
.page-tab,
.modified-line,
.preview-overlay-toolbar {
  color: #dce4f3;
  background: #202738;
  border-color: #3a455a;
}

.page-tab {
  color: #bdc8dc;
}

.page-tab:hover,
.page-tab:focus-visible {
  color: #d8d2ff;
  border-color: #8b7cf2;
}

.page-tab.selected {
  color: #fff;
  background: #7461e8;
  border-color: #7461e8;
}

.page-preview {
  border-color: #48546c;
}

.preview-overlay-panel {
  background: #191e2a;
}

.badge {
  color: #d2c8ff;
  background: #31295a;
}

.badge.approved {
  color: #a7edbd;
  background: #183e2b;
}

.badge.ignored {
  color: #c1cada;
  background: #2a3242;
}
