@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@200;300;400;500;600;700&display=swap");

:root {
  --brand-accent: #ff0808;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-soft: #f2f5f5;
  --button-bg: #dce5e5;
  --button-hover: #c8d5d5;
  --text: rgba(0, 0, 0, .62);
  --muted: rgba(0, 0, 0, .45);
  --line: color-mix(in srgb, var(--brand-accent) 18%, #ffffff);
  --dashboard-bg: #ffffff;
  --dashboard-panel: #f2f5f5;
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

body.dashboard-page {
  min-height: 100vh;
  overflow: auto;
  background: #ffffff;
  color: var(--text);
}

.dashboard-page button,
.dashboard-page .button,
.dashboard-page input {
  border-radius: 0;
}

.dashboard-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: grid;
  align-content: start;
  gap: 0;
  width: 300px;
  padding: 0;
  background: #f2f5f5;
  color: var(--text);
}

.dashboard-brand {
  height: 100px;
  min-height: 100px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 52px;
  background: #f7f9f9;
  color: var(--text);
  text-decoration: none;
}

.dashboard-brand .mark {
  box-shadow: none;
}

.dashboard-brand img {
  display: block;
  width: 186px;
  height: auto;
}

.dashboard-nav {
  display: grid;
  gap: 0;
  padding: 0;
  margin-top: 0;
}

.dashboard-nav a {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 52px;
  border-radius: 0;
  background: transparent;
  color: #979b9b;
  font-weight: 400;
  text-decoration: none;
}

.dashboard-nav .sign-out-btn {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 0 52px;
  border-radius: 0;
  background: transparent;
  color: #e63946;
  font-weight: 400;
  font-family: inherit;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  margin-top: auto;
}

.dashboard-nav .sign-out-btn:hover {
  background: #fcebeb;
}

.dashboard-nav a.active,
.dashboard-nav a:hover {
  background: #dce5e5;
  color: #6b6b6b;
}

.dashboard-nav a:not(.active):hover {
  background: var(--button-hover);
  color: #6b6b6b;
}

.projects-main {
  min-height: 100vh;
  margin-left: 300px;
  padding: 76px clamp(52px, 6vw, 96px);
  background: #ffffff;
}

.projects-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.projects-heading-actions {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.projects-heading h1 {
  margin: 0 0 10px;
  color: #6b6b6b;
  font-size: clamp(2.35rem, 4vw, 3.45rem);
  font-weight: 300;
  line-height: 1.02;
}

.projects-heading p {
  max-width: 620px;
}

.project-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) 170px;
  gap: 10px;
  max-width: none;
  margin-bottom: 36px;
}

.icon-search-button {
  width: 52px;
  min-height: 52px;
  padding: 0;
  background: #ffffff;
}

.icon-search-button span {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid #979b9b;
  border-radius: 50%;
}

.icon-search-button span::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: -5px;
  width: 8px;
  height: 2px;
  background: #979b9b;
  transform: rotate(45deg);
  transform-origin: left center;
}

.icon-search-button:hover {
  background: #dce5e5;
}

.icon-search-button:hover span {
  border-color: #6b6b6b;
}

.icon-search-button:hover span::after {
  background: #6b6b6b;
}

.project-tools button,
.search-field input {
  width: 100%;
  min-height: 52px;
  border: 0;
  background: var(--button-bg);
  color: var(--text);
}

.project-tools button:hover {
  background: var(--button-hover);
}

.search-field {
  display: grid;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 28px;
  margin-bottom: 72px;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  background: #f2f5f5;
  color: var(--text);
  box-shadow: none;
}

.project-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.project-link img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: saturate(.9);
}

.project-preview {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  background: #dce5e5;
  color: var(--brand-accent);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 500;
}

.preview-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  background: rgba(173, 216, 230, 0);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 10;
}

.preview-nav.left { left: 0; }
.preview-nav.right { right: 0; }

.project-preview:hover .preview-nav {
  opacity: 1;
}

.preview-nav:hover {
  background: rgba(173, 216, 230, 0.7);
}

.project-link div {
  min-height: 86px;
  padding: 18px 20px;
}

.project-card h2,
.project-card p {
  margin: 0;
}

.project-card h2 {
  margin-bottom: 8px;
  color: #6b6b6b;
  font-size: 1.12rem;
  font-weight: 500;
  padding-right: 60px;
}

.project-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 0;
  background: rgba(255, 255, 255, .92);
  color: #171d2a;
  font-size: .72rem;
  font-weight: 700;
}

.project-status.published {
  color: #125c3d;
}

.project-delete-btn {
  position: absolute;
  top: 14px;
  right: 11px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent !important;
  border: none;
  cursor: pointer;
  opacity: 1;
}

.project-settings-btn {
  position: absolute;
  top: 14px;
  right: 35px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent !important;
  border: none;
  cursor: pointer;
  opacity: 1;
}

.project-delete-icon {
  display: block;
  width: 14px;
  height: 16px;
  background: #b6b8b8;
  -webkit-mask: url("assets/bin.png?v=2") center / contain no-repeat;
  mask: url("assets/bin.png?v=2") center / contain no-repeat;
  transition: background 0.2s;
}

.project-settings-icon {
  display: block;
  width: 16px;
  height: 16px;
  background: #b6b8b8;
  -webkit-mask: url("assets/settings.png") center / contain no-repeat;
  mask: url("assets/settings.png") center / contain no-repeat;
  transition: background 0.2s;
}

.project-delete-btn:hover .project-delete-icon,
.project-settings-btn:hover .project-settings-icon {
  background: #6b6b6b;
}

.project-card-action {
  color: var(--muted) !important;
  transition: background 0.2s, color 0.2s;
}

.project-card-action:hover {
  color: var(--text) !important;
  background: var(--button-hover) !important;
}

.project-menu {
  position: absolute;
  right: 12px;
  bottom: 58px;
}

.project-menu summary {
  display: grid;
  width: 40px;
  height: 34px;
  place-items: center;
  border-radius: 0;
  background: var(--button-bg);
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
  list-style: none;
}

.project-menu summary::-webkit-details-marker {
  display: none;
}

.project-menu[open] {
  z-index: 3;
}

.project-menu[open] summary {
  background: var(--button-hover);
}

.project-menu button {
  position: relative;
  right: 0;
  display: block;
  width: 164px;
  min-height: 36px;
  border-radius: 0;
  background: var(--button-bg);
  text-align: left;
  box-shadow: 0 1px 0 #eef0ef;
}

.project-menu button:hover {
  background: color-mix(in srgb, var(--brand-accent) 12%, #ffffff);
}

.project-menu .danger {
  color: #a2191f;
}

.account-settings {
  max-width: 1180px;
  padding: 0 0 72px;
}

.account-settings-page {
  padding-top: 0;
}

.settings-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.settings-heading h1,
.settings-heading h2,
.settings-heading p,
.section-label {
  margin: 0;
}

.section-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.settings-heading h1,
.settings-heading h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  line-height: 1;
}

.settings-heading h1 {
  margin-bottom: 0;
  color: #6b6b6b;
  font-size: clamp(2.35rem, 4vw, 3.45rem);
  font-weight: 300;
}

.settings-heading > p {
  max-width: 420px;
  color: var(--muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(320px, 1fr);
  gap: 28px;
}

.settings-panel {
  display: grid;
  gap: 16px;
  padding: 0;
  background: transparent;
}

.settings-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.settings-panel input,
.settings-panel textarea {
  width: 100%;
  border: 0;
  background: var(--button-bg);
  color: var(--text);
  font: inherit;
}

.settings-panel input {
  min-height: 42px;
  padding: 0 12px;
}

.settings-panel textarea {
  min-height: 92px;
  padding: 11px 12px;
  resize: vertical;
}

.field-hint {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 500;
}

.colour-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
}

.colour-row input[type="color"] {
  padding: 4px;
}

.toggle-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  padding: 12px;
  background: var(--button-bg);
  color: var(--text);
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  padding: 0;
}

.settings-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.settings-actions button {
  min-height: 42px;
}

.settings-actions #settingsStatus {
  color: var(--muted);
  font-size: .84rem;
}

.welcome-preview {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  background: #f2f5f5;
}

.welcome-preview > img {
  position: absolute;
  inset: 0;
  width: 122%;
  height: 100%;
  object-fit: cover;
  animation: previewPan 9s ease-in-out infinite alternate;
}

.welcome-preview-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 18px;
  padding: clamp(28px, 5vw, 56px);
  background: rgba(0, 0, 0, .2);
  color: #ffffff;
  text-shadow: none;
}

.welcome-preview-overlay h3,
.welcome-preview-overlay p {
  margin: 0;
  max-width: 390px;
}

.welcome-preview-overlay h3 {
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: .95;
}

.welcome-preview-overlay p {
  font-size: 1rem;
}

.welcome-preview-overlay span {
  display: inline-grid;
  min-height: 44px;
  place-items: center;
  padding: 0 22px;
  background: var(--tour-accent, var(--brand-accent));
  color: #ffffff;
  font-weight: 700;
}

.logo-preview {
  max-width: 150px;
  max-height: 72px;
  object-fit: contain;
}

.logo-preview[hidden] {
  display: none;
}

.project-create-form,
.account-notice,
.empty-projects,
.calculator-controls,
.calculator-notes {
  display: grid;
  gap: 14px;
  margin-bottom: 30px;
  padding: 24px;
  background: #f2f5f5;
  box-shadow: none;
}

.project-create-form[hidden],
.account-notice[hidden],
.empty-projects[hidden] {
  display: none;
}

.project-create-form {
  max-width: 620px;
}

.project-create-form label,
.calculator-controls label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
}

.project-create-form input,
.calculator-controls input {
  min-height: 42px;
  border: 0;
  background: var(--button-bg);
  padding: 0 12px;
  font: inherit;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-actions button,
.account-notice .button,
.projects-heading .button,
.calculator-controls button {
  min-height: 42px;
}

.account-notice strong,
.empty-projects h2,
.calculator-notes h2 {
  margin: 0;
  color: var(--brand-accent);
  font-weight: 500;
}

.account-notice p,
.empty-projects p,
.calculator-notes p {
  margin: 0;
  color: var(--muted);
}

.calculator-main {
  max-width: 1280px;
}

.calculator-controls {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.calculator-results {
  display: grid;
  gap: 0;
  margin-bottom: 30px;
  background: #f2f5f5;
  box-shadow: none;
}

.calculator-list-head,
.calculator-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .65fr) minmax(120px, .65fr) minmax(280px, 1.7fr);
  gap: 16px;
  align-items: start;
  padding: 15px 18px;
  box-shadow: inset 0 -1px 0 #eeeeee;
}

.calculator-list-head {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.calculator-row h2,
.calculator-row strong,
.calculator-row p,
.calculator-row small {
  margin: 0;
}

.calculator-row h2 {
  color: var(--brand-accent);
  font-size: 1rem;
  font-weight: 500;
}

.calculator-row strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
}

.calculator-row p,
.calculator-row small {
  color: var(--muted);
}

.calculator-row small {
  line-height: 1.35;
}

.source-note {
  font-size: .86rem;
}

@keyframes previewPan {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-18%);
  }
}

@media (max-width: 920px) {
  .dashboard-sidebar {
    position: static;
    width: auto;
  }

  .projects-main {
    margin-left: 0;
    padding: 32px 20px;
  }

  .projects-heading,
  .settings-heading,
  .project-tools,
  .project-grid,
  .settings-grid,
  .calculator-list-head,
  .calculator-row {
    grid-template-columns: 1fr;
  }

  .calculator-list-head {
    display: none;
  }

  .projects-heading,
  .settings-heading {
    display: grid;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  font-size: 15px;
}

a {
  color: inherit;
}

button,
.button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  border: 0;
  background: var(--button-bg);
  color: var(--text);
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button:hover {
  background: var(--button-hover);
}

.button.primary {
  background: var(--button-bg);
  color: var(--text);
}

input,
select {
  min-height: 38px;
  border: 0;
  background: #ffffff;
  padding: 0 11px;
  font: inherit;
}

.page {
  min-height: 100vh;
}

.site-header,
.account-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 clamp(18px, 4vw, 56px);
  background: #ffffff;
  color: var(--text);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.mark {
  width: 22px;
  height: 22px;
  border: 3px solid var(--brand-accent);
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px #ffffff;
}

.nav-actions {
  display: flex;
  gap: 0;
}


/* Auth Toggle Styles */
.auth-toggle {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.toggle-btn {
  background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: var(--muted);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}
.toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}
.toggle-btn.active {
  background: var(--button-bg);
  border-color: var(--button-bg);
  color: var(--text);
}
