/* The app shell, text, buttons and form controls. Shared components are in components.css,
   single-screen styles in screens.css and review.css. Values come from tokens.css. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  color: var(--color-text);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

p {
  margin: 0;
}

a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-hover);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

/* Shell */

.app-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 40px;
  max-width: var(--content-width-wide);
  height: 56px;
  margin: 0 auto;
  padding: 0 var(--space-8);
}

.app-name {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.app-name:hover {
  color: var(--color-text);
}

.app-mark {
  display: flex;
  color: var(--color-accent);
}

.app-nav {
  display: flex;
  align-self: stretch;
  gap: 28px;
}

.app-nav a {
  display: flex;
  align-items: center;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--color-muted);
  font-weight: 500;
  text-decoration: none;
}

.app-nav a:hover {
  color: var(--color-text);
}

.app-nav a[aria-current] {
  color: var(--color-text);
  border-bottom-color: var(--color-accent);
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-8) var(--space-12);
}

.app-main.is-wide {
  max-width: var(--content-width-wide);
  padding-top: var(--space-6);
}

/* Text and layout helpers */

.lead {
  max-width: 640px;
  color: var(--color-text-2);
}

.muted {
  color: var(--color-muted);
}

.secondary-text {
  color: var(--color-text-2);
}

.small {
  font-size: 13px;
  white-space: nowrap;
}

.strong {
  font-weight: 600;
}

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.narrow {
  max-width: 1120px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-6);
  margin-bottom: var(--space-5);
}

.page-head h1 {
  margin: 0;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.actions-ruled {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
}

/* Steps */

.steps {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 28px;
  padding: 0;
  list-style: none;
  color: var(--color-muted);
  font-size: 13px;
}

.step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.step-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  font-size: 12px;
}

.step-current {
  color: var(--color-text);
  font-weight: 500;
}

.step-current .step-mark {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: var(--color-accent-text);
}

.step-done .step-mark {
  border-color: var(--color-accent-tint);
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

.steps-line {
  width: 32px;
  height: 1px;
  background: var(--color-border-strong);
}

.steps-line.is-done {
  background: var(--color-accent);
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: var(--control-height);
  padding: 0 18px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-accent-text);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--color-accent-hover);
  color: var(--color-accent-text);
}

.button.secondary {
  padding: 0 16px;
  border-color: var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
}

.button.secondary:hover {
  background: var(--color-sunken);
}

.button.danger {
  border-color: var(--color-danger);
  background: var(--color-danger);
}

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

.button:disabled {
  border-color: var(--color-disabled);
  background: var(--color-disabled);
  color: var(--color-accent-text);
  cursor: not-allowed;
}

.button.secondary:disabled {
  border-color: var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
}

.small-button {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-danger {
  padding: 4px 6px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-danger);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.link-danger:hover {
  background: var(--color-danger-bg);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
}

.icon-button:hover:not(:disabled) {
  background: var(--color-sunken);
}

.icon-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Forms */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 360px;
}

.field label {
  font-weight: 500;
}

.field small,
.dropzone small {
  color: var(--color-muted);
  font-size: 13px;
}

select,
input[type="search"],
textarea {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  background: var(--color-surface);
}

select,
input[type="search"] {
  height: var(--control-height);
  padding: 0 12px;
}

textarea {
  width: 100%;
  padding: var(--space-2) 10px;
  line-height: 1.45;
  resize: vertical;
}

textarea:disabled {
  background: var(--color-bg);
  color: var(--color-text-2);
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 7px;
  background: #eceff2;
}

.tabs button {
  height: 30px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--color-text-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.tabs button[aria-selected="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-raised);
}

.tab-count {
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.tabs-fill button {
  flex: 1;
}

/* The fake renderer measures text here, off screen, in the page font. */

.fit-measurer {
  position: absolute;
  left: -10000px;
  top: 0;
  visibility: hidden;
  overflow: hidden;
  font-family: var(--font-page);
  line-height: var(--page-leading);
}
