/* C1-C10: the Google application card and the seven-step setup.

   The rail is also the state display, which is why its markers carry three
   states rather than two: done, here, and not yet. Geometry is the board's -
   900px, a 250px rail, 26px of padding - copied rather than rounded. */

.badge-recommended {
  border-color: var(--c-green-darker);
  color: var(--c-green);
}

.out-link {
  align-self: flex-start;
  column-gap: 10px;
}

.icon-button {
  appearance: none;
  border: none;
  background: none;
  color: var(--c-neutral-9);
  font: var(--t-body-primary-400);
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.icon-button:hover {
  color: var(--c-white);
  background: var(--surface-hover);
}

/* C5's quiet line above the card it opens. */
.own-calendar-strip {
  display: flex;
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--c-neutral-2);
  border-radius: 10px;
  padding: 14px 20px;
  font: var(--t-body-small-400);
  color: var(--text-body);
}

.own-calendar-strip p {
  margin: 0;
}

.own-calendar-strip strong {
  color: var(--c-white);
  font: var(--t-body-small-500);
}

.own-calendar-strip .link {
  margin-left: auto;
  white-space: nowrap;
}

.scope-box {
  flex-direction: column;
  row-gap: 8px;
}

.scope-box dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  row-gap: 6px;
}

.scope-box dl > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
}

.scope-box dt {
  font: var(--t-code-400);
  color: var(--c-blue-lighter);
}

.scope-box dd {
  margin: 0;
  font: var(--t-body-small-300);
  color: var(--text-body);
}

/* The modal: a rail and a pane, with no padding of its own - each side has
   its own. */
.modal-backdrop:has(> .modal-setup) {
  background: rgba(13, 14, 15, 0.8);
}

.modal-setup {
  width: 900px;
  max-width: 100%;
  padding: 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  row-gap: 0;
  overflow: hidden;
}

.wizard-rail {
  padding: 26px 22px;
  border-right: 1px solid var(--c-neutral-2);
  background: var(--c-neutral-1-2);
}

.wizard-rail-title {
  margin: 0 0 18px;
  font: var(--t-body-small-400);
  color: var(--text-muted);
}

.wizard-rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  row-gap: 4px;
}

.rail-row {
  display: flex;
  align-items: center;
  column-gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font: var(--t-body-small-400);
  color: var(--text-muted);
}

.rail-tick {
  display: none;
}

.rail-row-done .rail-number {
  display: none;
}

.rail-row-done .rail-tick {
  display: block;
}

.rail-mark {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--c-neutral-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: var(--t-body-small-400);
  color: var(--c-neutral-9);
}

.rail-row-done {
  color: var(--text-body);
}

.rail-row-done .rail-mark {
  border-color: var(--c-green);
  color: var(--c-green);
}

.rail-row-here {
  background: var(--c-neutral-1);
  color: var(--c-white);
}

.rail-row-here .rail-mark {
  background: var(--c-blue);
  border-color: var(--c-blue);
  color: var(--c-white);
}

.wizard-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 88vh;
}

.wizard-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  column-gap: 16px;
  padding: 22px 26px 0;
}

.wizard-pane-head .step-marker {
  margin: 0;
}

/* Below the rail breakpoint the step number needs a line to sit on. */
.wizard-line {
  display: none;
  height: 3px;
  background: var(--c-neutral-3);
  margin: 12px 26px 0;
  border-radius: 3px;
}

.wizard-line span {
  display: block;
  height: 100%;
  width: 14%;
  background: var(--c-blue);
  border-radius: 3px;
  transition: width var(--transition-default);
}

.wizard-body {
  padding: 8px 26px 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

/* The rail carries the name of this thing; on a sheet there is no rail. */
.wizard-sheet-title {
  display: none;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  row-gap: 18px;
}

.wizard-step h2.with-tick {
  display: flex;
  align-items: center;
  column-gap: 12px;
}

.wizard-step h2 {
  font: var(--t-h6-500);
  letter-spacing: var(--ls-h6);
  color: var(--c-white);
  margin: 8px 0 0;
}

.wizard-step .field label {
  color: var(--text-body);
}

.wizard-step .connection-facts {
  border-bottom: none;
  padding: 16px 18px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 10px;
}

.wizard-foot {
  border-top: 1px solid var(--c-neutral-2);
  padding: 18px 26px;
  display: flex;
  align-items: center;
  column-gap: 24px;
}

.wizard-foot .fine-print {
  margin: 0;
  max-width: 340px;
}

.wizard-buttons {
  margin-left: auto;
  display: flex;
  column-gap: 12px;
}

/* Step 4: two cards that are a radio each, so the whole card is the target. */
.radio-cards {
  display: flex;
  flex-direction: column;
  row-gap: 12px;
}

.radio-card {
  display: flex;
  flex-direction: column;
  row-gap: 8px;
  border: 1px solid var(--c-neutral-3);
  border-radius: 10px;
  padding: 16px 18px 18px 46px;
  position: relative;
  cursor: pointer;
}

.radio-card input[type="radio"] {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 18px;
  height: 18px;
  accent-color: var(--c-blue);
}

.radio-card-on {
  border-color: var(--c-blue);
  background: var(--grad-card-hover-fill);
}

.radio-card-head {
  display: flex;
  align-items: center;
  column-gap: 10px;
  color: var(--c-white);
  font: var(--t-body-primary-500);
}

.radio-card-body {
  font: var(--t-body-primary-300);
  color: var(--text-body);
}

/* Step 6: two tabs over one job. */
.wizard-tabs {
  display: flex;
  column-gap: 28px;
  border-bottom: 1px solid var(--c-neutral-2);
}

.wizard-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 10px;
  font: var(--t-body-primary-400);
  color: var(--text-muted);
  cursor: pointer;
}

.wizard-tab:hover {
  color: var(--c-white);
}

.wizard-tab-on {
  color: var(--c-white);
  border-bottom-color: var(--c-white);
}

.checking-line {
  display: flex;
  align-items: center;
  column-gap: 12px;
}

.spinner-small {
  width: 16px;
  height: 16px;
  border-width: 2px;
  flex: none;
}

.refusal-line {
  border: 1px solid var(--c-neutral-3);
  border-radius: 8px;
  background: var(--c-neutral-1);
  padding: 10px 14px;
  font: var(--t-code-400);
  color: var(--c-white);
  overflow-wrap: anywhere;
}

.checkbox-boxed {
  border: 1px solid var(--c-neutral-3);
  border-radius: 10px;
  padding: 16px 18px;
}

/* 768-1199: no room for the rail, so the step number and a line carry the
   same information. */
@media (max-width: 1199px) {
  .modal-setup {
    grid-template-columns: minmax(0, 1fr);
    width: 720px;
  }

  .wizard-rail {
    display: none;
  }

  .wizard-line {
    display: block;
  }

  /* No rail means nothing says what this is, so the header says it. */
  .wizard-sheet-title {
    display: block;
    margin: 0;
    font: var(--t-body-primary-500);
    color: var(--c-white);
  }

  .wizard-pane-head > div {
    display: flex;
    flex: 1 1 auto;
    justify-content: space-between;
    align-items: baseline;
    column-gap: 16px;
  }

  /* Two short fields still fit side by side here; the design keeps them. */
  .wizard-step .grid-two {
    grid-template-columns: 1fr 1fr;
  }
}

/* Below 768 it is a sheet: full height, one column, a thumb-sized button. */
@media (max-width: 767px) {
  .modal-backdrop {
    padding: 0;
  }

  .modal-setup {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    /* The pane has to be allowed to be shorter than its content, or the
       footer - the two buttons - lands below the fold. */
    grid-template-rows: minmax(0, 1fr);
  }

  .wizard-pane {
    max-height: none;
    height: 100%;
  }

  .wizard-pane-head,
  .wizard-body,
  .wizard-foot {
    padding-left: 20px;
    padding-right: 20px;
  }

  .wizard-line {
    margin-left: 20px;
    margin-right: 20px;
  }

  .wizard-pane-head > div {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 6px;
  }

  .wizard-step .grid-two {
    grid-template-columns: 1fr;
  }

  /* One thumb, two buttons. The note about progress being kept is a desktop
     reassurance; on a sheet it costs a line of the thing being read. */
  .wizard-foot {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .wizard-foot .fine-print {
    display: none;
  }

  .wizard-buttons {
    margin-left: 0;
    width: 100%;
  }

  .wizard-buttons .button {
    flex: 3 1 auto;
    height: 46px;
  }

  .wizard-buttons [data-wizard-back] {
    flex: 1 1 auto;
  }

  .copy-row code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .own-calendar-strip {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .own-calendar-strip .link {
    margin-left: 0;
  }
}

/* A button is as wide as its words. In a card that is a flex column it
   stretches to the card unless it is told not to. */
.connection-card > .button,
.connection-card > a.button {
  align-self: flex-start;
}

/* C1, C5 and C7 are drawn wider than the forms in the other sections: the
   card carries a table of facts rather than a column of fields. */
.settings-section[data-panel="calendar"] {
  max-width: 820px;
}
