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

:root {
  font-family: "DM Sans", sans-serif;
  color: #102d1c;
  background: #75bd82;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --green-950: #123923;
  --green-900: #19492d;
  --green-800: #28613a;
  --green-100: #e5f2df;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  padding: 18px;
  background:
    radial-gradient(ellipse at 50% 0%, rgb(208 237 190 / 36%), transparent 55%),
    #75bd82;
}

button {
  font: inherit;
}

.dashboard {
  position: relative;
  display: flex;
  min-height: calc(100vh - 36px);
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--green-900);
  border-radius: 20px;
  padding: clamp(24px, 5vw, 64px);
  background: rgb(143 205 145 / 42%);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 13px;
  color: inherit;
  text-decoration: none;
}

.brand-link:focus-visible {
  outline: 3px solid #f2ffe9;
  outline-offset: 4px;
}

.settings-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 12px;
  padding: 0 13px;
  background: rgb(231 243 223 / 77%);
  color: var(--green-950);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.settings-link:hover {
  transform: translateY(-2px);
  border-color: var(--green-900);
  background: #edf7e7;
}

.settings-link:focus-visible {
  outline: 3px solid #f2ffe9;
  outline-offset: 3px;
}

.settings-mark {
  color: var(--green-900);
  font-family: "Manrope", sans-serif;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.09em;
  line-height: 1;
}

.brand-mark {
  display: inline-flex;
  height: 42px;
  align-items: center;
  gap: 2px;
  border: 1px solid var(--green-900);
  border-radius: 13px;
  padding: 0 9px 0 7px;
  background: var(--green-950);
  color: #e6f4dc;
}

.brand-mark-initial {
  font-family: "Manrope", sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
}

.brand-mark-word {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.eyebrow {
  display: block;
  margin: 0;
  color: var(--green-800);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.19em;
}

.brand-name {
  display: block;
  margin: 1px 0 0;
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.welcome {
  width: min(100%, 660px);
  margin: clamp(52px, 10vh, 100px) auto 44px;
  text-align: center;
}

.welcome-eyebrow {
  margin-bottom: 14px;
  letter-spacing: 0.24em;
}

h1 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 800;
  letter-spacing: -0.075em;
  line-height: 1.04;
}

.welcome-copy {
  margin: 16px 0 0;
  color: #31563b;
  font-size: clamp(14px, 2vw, 16px);
  line-height: 1.6;
}

.product-selector {
  display: grid;
  width: min(100%, 500px);
  gap: 9px;
  margin: 0 auto 26px;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgb(231 243 223 / 77%);
}

.product-selector label {
  color: var(--green-950);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.product-selector select {
  width: 100%;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 9px;
  padding: 11px 12px;
  background: #f8fbf4;
  color: var(--green-950);
  font: inherit;
  font-size: 14px;
}

.product-selector select:focus {
  border-color: var(--green-800);
  outline: 3px solid rgb(40 97 58 / 16%);
}

.product-selector select:disabled {
  color: #45654b;
}

.main-menu {
  display: grid;
  width: min(100%, 920px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto;
}

.menu-card {
  display: grid;
  min-height: 132px;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 16px;
  border: 1px solid rgb(25 73 45 / 43%);
  border-radius: 14px;
  padding: 24px;
  background: rgb(231 243 223 / 77%);
  color: var(--green-950);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.menu-card:hover {
  transform: translateY(-3px);
  border-color: var(--green-900);
  background: #edf7e7;
  box-shadow: 0 10px 24px rgb(21 70 38 / 12%);
}

.menu-card:focus-visible {
  outline: 3px solid #f2ffe9;
  outline-offset: 3px;
}

.menu-card[aria-pressed="true"] {
  border-color: var(--green-950);
  background: #f2f8e9;
  box-shadow: inset 0 0 0 1px var(--green-950);
}

.card-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(25 73 45 / 19%);
  border-radius: 12px;
  background: #d5e9cd;
}

.card-icon svg {
  width: 23px;
  height: 23px;
  stroke: var(--green-900);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.card-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.card-arrow {
  align-self: start;
  color: #548260;
  font-size: 18px;
  transition: transform 160ms ease;
}

.menu-card:hover .card-arrow {
  transform: translate(2px, -2px);
}

.selection-status {
  min-height: 24px;
  margin: 2px 0 0;
  color: #31563b;
  font-size: 13px;
  text-align: center;
}

.selection-status[data-error="true"] {
  color: #8a2929;
}

.active-product {
  width: fit-content;
  margin: -10px 0 22px;
  border: 1px solid rgb(25 73 45 / 24%);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgb(231 243 223 / 77%);
  color: var(--green-900);
  font-size: 12px;
  font-weight: 700;
}

.active-product a,
.selection-status a {
  color: var(--green-950);
  font-weight: 700;
  text-underline-offset: 3px;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 44px;
  color: #366344;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.requirements-page {
  width: min(100%, 840px);
  margin: clamp(44px, 8vh, 80px) auto 0;
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  color: var(--green-900);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.page-back:hover {
  text-decoration: underline;
}

.requirements-heading {
  margin-bottom: 28px;
}

.requirements-heading h1 {
  font-size: clamp(38px, 6vw, 56px);
}

.requirements-heading .welcome-copy {
  margin-top: 10px;
}

.requirement-form,
.requirement-entry {
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 14px;
  padding: clamp(18px, 4vw, 28px);
  background: rgb(231 243 223 / 82%);
}

.requirement-form {
  display: grid;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field label,
.field-label {
  color: var(--green-950);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.requirement-form input,
.requirement-form textarea {
  width: 100%;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 9px;
  padding: 12px 14px;
  background: #f8fbf4;
  color: var(--green-950);
  font: inherit;
  font-size: 14px;
}

.requirement-form input:focus,
.requirement-form textarea:focus {
  border-color: var(--green-800);
  outline: 3px solid rgb(40 97 58 / 16%);
}

.requirement-form input[readonly] {
  background: #dcebd5;
  font-weight: 700;
}

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

.covered-tests {
  display: flex;
  min-height: 45px;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 9px;
  padding: 6px 10px;
  background: #f8fbf4;
}

.covered-tests:focus-within {
  border-color: var(--green-800);
  outline: 3px solid rgb(40 97 58 / 16%);
}

.covered-tests input {
  min-width: 150px;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 6px 2px;
  background: transparent;
}

.covered-tests input:focus {
  outline: 0;
}

.test-id-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 9px;
  background: #dcebd5;
  color: var(--green-950);
  font-size: 12px;
  font-weight: 700;
}

.test-id-chip button {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.field-hint {
  margin: 0;
  color: #45654b;
  font-size: 12px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.primary-button {
  border: 1px solid var(--green-950);
  border-radius: 9px;
  padding: 11px 18px;
  background: var(--green-950);
  color: #f2f8e9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--green-900);
}

.new-requirement-button {
  margin-bottom: 18px;
}

.primary-button:focus-visible,
.test-id-chip button:focus-visible {
  outline: 3px solid #7daf79;
  outline-offset: 2px;
}

.form-message {
  margin: 0;
  color: var(--green-900);
  font-size: 13px;
}

.form-message[data-error="true"] {
  color: #8a2929;
}

.saved-requirements {
  display: grid;
  gap: 12px;
  margin-top: 36px;
}

.saved-requirements h2 {
  margin: 0 0 2px;
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  letter-spacing: -0.04em;
}

.settings-form {
  max-width: 620px;
}

.product-name-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-name-list li {
  border: 1px solid rgb(25 73 45 / 24%);
  border-radius: 9px;
  padding: 12px 15px;
  background: rgb(231 243 223 / 82%);
  color: var(--green-950);
  font-size: 14px;
  font-weight: 600;
}

.empty-requirements {
  margin: 0;
  color: #31563b;
  font-size: 13px;
}

.requirement-table-wrap {
  overflow-x: auto;
  border: 1px solid rgb(25 73 45 / 35%);
  border-radius: 12px;
  background: rgb(231 243 223 / 82%);
}

.requirements-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.requirements-table th,
.requirements-table td {
  border-bottom: 1px solid rgb(25 73 45 / 17%);
  padding: 14px 16px;
  vertical-align: top;
}

.requirements-table thead th {
  background: rgb(213 233 205 / 75%);
  color: var(--green-900);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.requirements-table tbody tr:last-child td {
  border-bottom: 0;
}

.requirements-table tbody tr:last-child th {
  border-bottom: 0;
}

.requirements-table .requirement-id {
  color: var(--green-800);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.requirement-row-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-950);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.requirement-row-toggle:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.requirement-row-toggle:focus-visible {
  border-radius: 3px;
  outline: 3px solid #7daf79;
  outline-offset: 3px;
}

.requirement-table-description {
  max-width: 300px;
  color: #31563b;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.requirement-detail-row[hidden] {
  display: none;
}

.requirements-table .requirement-detail-row > td {
  padding: 0;
  border-bottom: 1px solid rgb(25 73 45 / 25%);
  background: rgb(213 233 205 / 35%);
}

.requirement-edit-form {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.secondary-button {
  border: 1px solid rgb(25 73 45 / 45%);
  border-radius: 9px;
  padding: 10px 16px;
  background: transparent;
  color: var(--green-900);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button:hover {
  background: #dcebd5;
}

.test-library-page {
  width: min(100%, 1080px);
}

.test-form {
  margin-bottom: 28px;
}

.test-steps-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgb(25 73 45 / 25%);
  border-radius: 9px;
  background: #f8fbf4;
}

.test-steps-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.test-steps-table th,
.test-steps-table td {
  min-width: 95px;
  border-bottom: 1px solid rgb(25 73 45 / 16%);
  padding: 9px 10px;
  vertical-align: top;
}

.test-steps-table th {
  background: #dcebd5;
  color: var(--green-900);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.test-steps-table th:nth-child(2),
.test-steps-table th:nth-child(3) {
  min-width: 200px;
}

.test-steps-table td:first-child {
  width: 64px;
}

.test-steps-table td:nth-child(4) {
  width: 150px;
}

.test-steps-table td:last-child {
  width: 42px;
}

.test-steps-table textarea,
.test-steps-table select {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgb(25 73 45 / 28%);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  color: var(--green-950);
  font: inherit;
  font-size: 13px;
}

.test-steps-table textarea {
  min-height: 56px;
  resize: vertical;
}

.test-steps-table textarea:focus,
.test-steps-table select:focus {
  border-color: var(--green-800);
  outline: 3px solid rgb(40 97 58 / 16%);
}

.step-number {
  color: var(--green-800);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.step-actions-cell {
  text-align: center;
}

.remove-step-button {
  width: 30px;
  height: 30px;
  border: 1px solid rgb(25 73 45 / 30%);
  border-radius: 7px;
  background: transparent;
  color: var(--green-900);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
}

.remove-step-button:hover {
  background: #dcebd5;
}

.add-test-step-button {
  align-self: start;
  margin-top: 10px;
}

.saved-tests-table td,
.saved-tests-table th {
  vertical-align: middle;
}

.saved-tests-table td:last-child {
  color: #31563b;
  font-size: 13px;
}

.saved-tests-table .test-steps-table-wrap {
  margin: 4px;
}

.saved-tests-table .test-steps-table td {
  color: var(--green-950);
  font-size: 13px;
  white-space: pre-wrap;
}

.requirement-checkbox-list {
  display: grid;
  max-height: 180px;
  gap: 2px;
  overflow-y: auto;
  border: 1px solid rgb(25 73 45 / 30%);
  border-radius: 9px;
  padding: 8px;
  background: #f8fbf4;
}

.requirement-choice {
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 6px;
  padding: 7px 8px;
  color: var(--green-950);
  cursor: pointer;
  font-size: 13px;
}

.requirement-choice:hover {
  background: #e7f1e1;
}

.requirement-choice input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--green-900);
}

.test-requirement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.test-requirement-tag {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgb(25 73 45 / 16%);
  border-radius: 999px;
  padding: 4px 8px;
  background: #dcebd5;
  color: var(--green-900);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.step-status-label {
  font-weight: 700;
  white-space: nowrap;
}

.status-automatisert {
  color: #206333;
}

.status-manuell {
  color: #805c13;
}

.run-form {
  margin-bottom: 28px;
}

.run-test-selection {
  min-width: 0;
  border: 0;
  padding: 0;
}

.run-test-selection legend {
  margin-bottom: 8px;
}

.run-status-påbegynt {
  color: #805c13;
}

.run-status-fullført {
  color: #206333;
}

.run-continue-button {
  padding: 8px 12px;
  white-space: nowrap;
}

.run-details {
  display: grid;
  gap: 20px;
  padding: clamp(16px, 3vw, 24px);
  background: rgb(213 233 205 / 35%);
}

.run-details-heading,
.run-test h4 {
  margin: 0;
  color: var(--green-950);
  font-family: "Manrope", sans-serif;
}

.run-details-heading {
  font-size: 18px;
}

.run-test {
  display: grid;
  gap: 10px;
}

.run-test h4 {
  font-size: 14px;
}

.run-steps-table th:nth-child(4) {
  min-width: 115px;
}

.run-steps-table th:last-child {
  min-width: 200px;
}

.run-steps-table select {
  min-width: 125px;
}

.run-steps-table th:nth-child(5) {
  min-width: 140px;
}

.run-failure-field {
  display: grid;
  min-width: 180px;
  gap: 6px;
  color: #8a2929;
  font-size: 11px;
  font-weight: 700;
}

.run-failure-field[hidden] {
  display: none;
}

.run-failure-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid rgb(138 41 41 / 35%);
  border-radius: 7px;
  padding: 8px;
  background: #fff;
  color: var(--green-950);
  font: inherit;
  font-size: 12px;
  font-weight: 400;
  resize: vertical;
}

.run-failure-input:focus {
  border-color: #8a2929;
  outline: 3px solid rgb(138 41 41 / 14%);
}

.run-failure-reason {
  min-width: 180px;
  color: #8a2929;
  font-size: 12px;
  white-space: pre-wrap;
}

.run-actions {
  flex-wrap: wrap;
}

.run-message {
  flex-basis: 100%;
}

.execution-ikke-kjørt {
  color: #45654b;
}

.execution-bestått {
  color: #206333;
}

.execution-feilet {
  color: #8a2929;
}

.execution-blokkert {
  color: #805c13;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.requirement-covered {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.requirement-covered:empty {
  display: none;
}

.requirement-form[hidden] {
  display: none;
}

@media (max-width: 580px) {
  body {
    padding: 10px;
  }

  .dashboard {
    min-height: calc(100vh - 20px);
    border-radius: 16px;
    padding: 24px 18px;
  }

  .welcome {
    margin-top: 64px;
    margin-bottom: 32px;
  }

  .main-menu {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .menu-card {
    min-height: 88px;
    padding: 18px;
  }

  .footer {
    padding-top: 36px;
    font-size: 8px;
  }

  .requirements-page {
    margin-top: 40px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
