:root {
  color-scheme: dark;
  --bg: #111317;
  --panel: #1b1f26;
  --panel-2: #222832;
  --line: #343b48;
  --text: #f3f6fb;
  --muted: #9aa7b8;
  --field: #141820;
  --focus: #5cc8ff;
  --accent: #4f8cff;
  --accent-2: #2fc48d;
  --danger: #e64a5e;
  --warning: #e5a83b;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(79, 140, 255, 0.16), transparent 34%),
    linear-gradient(315deg, rgba(47, 196, 141, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(1120px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px;
  place-items: start center;
}

.workspace {
  width: min(910px, 100%);
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  min-height: 76px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 64px;
  background: linear-gradient(180deg, #f5f7fb, #7fb3ff);
  color: #152033;
  clip-path: polygon(50% 0, 92% 16%, 86% 72%, 50% 100%, 14% 72%, 8% 16%);
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: var(--shadow);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.1;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
}

.access-form,
.report-form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  justify-items: center;
}

.access-form[hidden],
.report-form[hidden] {
  display: none !important;
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.access-panel {
  display: grid;
  grid-template-columns: minmax(240px, 420px) auto;
  align-items: end;
  gap: 14px;
  width: min(620px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 31, 38, 0.92);
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  outline: none;
}

input {
  height: 46px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  padding: 12px 14px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.18);
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
}

.conclusion-wrap {
  display: grid;
  width: 100%;
}

.criterion {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(27, 31, 38, 0.92);
}

.criterion-conclusion {
  border-color: rgba(92, 200, 255, 0.55);
  background: linear-gradient(180deg, rgba(79, 140, 255, 0.16), rgba(27, 31, 38, 0.96));
}

.criterion-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.criterion h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 17px;
  line-height: 1.25;
}

.info-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.info-button {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(92, 200, 255, 0.75);
  border-radius: 50%;
  background: rgba(92, 200, 255, 0.14);
  color: #dff5ff;
  cursor: help;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.info-button:hover {
  background: rgba(92, 200, 255, 0.24);
}

.info-button:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.18);
}

.info-tooltip {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 50%;
  width: min(320px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f131a;
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.info-wrap:hover .info-tooltip,
.info-wrap:focus-within .info-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rating {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
}

.rating input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.rating label {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}

.rating label span {
  color: inherit;
  font-size: 18px;
  line-height: 1;
  text-transform: none;
}

.rating input:checked + label {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.16);
}

.actionbar {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 14px 0 0;
  background: linear-gradient(180deg, transparent, var(--bg) 28%);
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-weight: 700;
}

.status.ok {
  color: var(--accent-2);
}

.status.error {
  color: var(--danger);
}

.submit-button {
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  gap: 8px;
  min-width: 150px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon {
  display: grid;
  place-items: center;
  font-size: 20px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 16px;
  }

  .identity-grid,
  .access-panel,
  .criteria-grid {
    grid-template-columns: 1fr;
  }

  .criterion-head {
    grid-template-columns: 1fr;
  }

  .rating {
    grid-auto-flow: column;
    justify-content: start;
  }

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

  .submit-button {
    width: 100%;
    justify-content: center;
  }
}
