/* ==========================================================================
   ENTRY: layout
   ========================================================================== */
.p-entry {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
  max-width: calc(1024px + var(--gutter) * 2);
  margin-inline: auto;
  padding: 120px var(--gutter) 160px;
}

.p-entry-step,
.p-thanks {
  display: flex;
  flex-direction: column;
  gap: 64px;
  width: 100%;
}

.p-entry-step[hidden] {
  display: none;
}

.p-entry__lead {
  line-height: 28px;
}

/* ==========================================================================
   ENTRY: steps (input / confirm / thanks)
   ========================================================================== */
.p-entry-steps {
  display: flex;
  justify-content: space-between;
  width: 300px;
}

.p-entry-steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 30px;
  color: #aaaaaa;
  font-size: 14px;
  font-weight: var(--fw-medium);
  line-height: 1.2;
  white-space: nowrap;
}

.p-entry-steps__item::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-line);
}

/* Line from the previous step */
.p-entry-steps__item + .p-entry-steps__item::after {
  content: "";
  position: absolute;
  top: 7px;
  right: calc(50% + 7px);
  width: 121px;
  height: 2px;
  background: var(--color-line);
}

.p-entry-steps__item.is-reached::before,
.p-entry-steps__item.is-reached::after {
  background: var(--color-blue);
}

.p-entry-steps__item[aria-current="step"] {
  color: var(--color-blue);
}

/* ==========================================================================
   ENTRY: form controls
   ========================================================================== */
.c-input {
  width: 100%;
  min-height: 76px;
  padding: 23px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-pale);
  color: var(--color-text);
  font: inherit;
  line-height: 28px;
  letter-spacing: inherit;
  transition: border-color var(--duration) var(--ease);
}

.c-input::placeholder {
  color: #aaaaaa;
}

.c-input:focus {
  border-color: var(--color-blue);
  outline: none;
}

.c-input--textarea {
  display: block;
  height: 300px;
  resize: vertical;
}

.c-input[aria-invalid="true"] {
  border-color: #cc0000;
}

.c-select {
  display: flex;
  align-items: center;
  gap: 15px;
}

.c-select__input {
  width: 200px;
  height: 78px;
  padding: 24px 48px 24px 24px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white) url("/assets/img/entry/select-arrow.svg") right 24px center / 10px 7px no-repeat;
  color: var(--color-text);
  font: inherit;
  line-height: 28px;
  letter-spacing: inherit;
  appearance: none;
  cursor: pointer;
}

.c-select__input:focus {
  border-color: var(--color-blue);
  outline: none;
}

.c-select__input[aria-invalid="true"] {
  border-color: #cc0000;
}

.c-check {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 28px;
  cursor: pointer;
}

.c-check__input {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white) center / 14px 11px no-repeat;
  appearance: none;
  cursor: pointer;
}

.c-check__input:checked {
  border-color: var(--color-blue);
  background-color: var(--color-blue);
  background-image: url("/assets/img/entry/check.svg");
}

.c-check__input:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

.c-button--lg {
  width: 480px;
  min-height: 80px;
  font-size: 15px;
}

.c-button--back {
  justify-content: center;
  background: #aaaaaa;
}

.c-button--back:hover {
  background: #999999;
}

.c-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ==========================================================================
   ENTRY: input
   ========================================================================== */
.p-entry-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
}

.p-entry-form__fields {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  padding-block: 80px;
  border-block: 1px solid var(--color-line);
}

.p-entry-field {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.p-entry-field__label {
  display: flex;
  align-self: start;
  align-items: center;
  min-height: 76px;
  padding: 0;
  font-weight: var(--fw-medium);
  line-height: 28px;
}

/* Legend can't be a grid item, so it is floated into the first column */
legend.p-entry-field__label {
  float: left;
  width: 224px;
}

.p-entry-field:has(.p-entry-field__checks) .p-entry-field__label {
  align-items: flex-start;
  min-height: 0;
}

.p-entry-field:has(.p-entry-field__selects) .p-entry-field__label {
  min-height: 78px;
}

.p-entry-field__req {
  color: #cc0000;
}

.p-entry-field__control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.p-entry-field__control--sub {
  gap: 16px;
}

.p-entry-field__checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 16px;
}

.p-entry-field__selects {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.p-entry-field__note {
  font-size: 12px;
  line-height: 20px;
}

.p-entry-field__error {
  color: #cc0000;
  font-size: 13px;
  line-height: 20px;
}

.p-entry-sub {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
}

.p-entry-sub__label {
  font-weight: var(--fw-medium);
  line-height: 28px;
}

.p-entry-form__policy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.p-entry-form__policy-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 5px;
  border-bottom: 1px solid var(--color-blue);
  color: var(--color-blue);
  line-height: 1.2;
}

.p-entry-form__policy-link::after {
  content: "";
  width: 8px;
  height: 8px;
  background: url("/assets/img/entry/ico-blank-blue.svg") center / contain no-repeat;
}

.p-entry-form__policy-link:hover {
  border-bottom-color: transparent;
}

/* ==========================================================================
   ENTRY: confirm
   ========================================================================== */
.p-entry-confirm {
  border-top: 1px solid var(--color-line);
}

.p-entry-confirm__row {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  padding-block: 40px;
  border-bottom: 1px solid var(--color-line);
  line-height: 28px;
}

.p-entry-confirm__row dt {
  font-weight: var(--fw-medium);
}

.p-entry-confirm__row dd {
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.p-entry-confirm__buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.p-entry-confirm__buttons .c-button {
  width: 400px;
}

.p-entry__send-error {
  color: #cc0000;
  text-align: center;
}

.p-entry__turnstile {
  display: flex;
  justify-content: center;
}

.p-entry__turnstile:empty {
  display: none;
}

/* ==========================================================================
   ENTRY: thanks
   ========================================================================== */
.p-thanks {
  align-items: center;
}

.p-thanks__head {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.p-thanks__title {
  color: var(--color-navy);
  font-family: var(--font-mincho);
  font-size: 40px;
  font-weight: var(--fw-medium);
  line-height: 64px;
}

.p-thanks__text {
  line-height: 28px;
}

.p-thanks__flow {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--color-pale);
}

.p-thanks__flow-title {
  color: var(--color-navy);
  font-family: var(--font-mincho);
  font-size: 24px;
  font-weight: var(--fw-medium);
  line-height: 40px;
  letter-spacing: var(--ls-xs);
}

/* Shares the recruiting flow, with shorter boxes */
.c-flow__items--thanks .c-flow__item {
  flex: 0 1 364px;
  min-height: 220px;
  padding: 32px 60px 32px 68px;
  background-image: url("/assets/img/entry/thanks-flow-mid.svg");
}

.c-flow__items--thanks .c-flow__item:first-child {
  flex-basis: 340px;
  padding: 32px 52px 32px 32px;
  background-image: url("/assets/img/entry/thanks-flow-first.svg");
}

.c-flow__items--thanks .c-flow__item:last-child {
  flex-basis: 340px;
  padding: 32px 40px 32px 68px;
  border: 0;
  background: url("/assets/img/entry/thanks-flow-last.svg") center / 100% 100% no-repeat;
}

.p-thanks .c-button--lg {
  width: 400px;
}

.c-flow__items--thanks .c-flow__text {
  max-width: none;
  padding-left: 0;
}

/* ==========================================================================
   ENTRY: tablet / SP
   ========================================================================== */
@media (max-width: 1079px) {
  .p-entry-field__checks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .p-entry-field__selects {
    flex-direction: column;
    gap: 16px;
  }

  .p-entry-field__selects .c-select__input {
    flex: 1;
    width: auto;
  }

  .c-flow__items--thanks .c-flow__item,
  .c-flow__items--thanks .c-flow__item:first-child,
  .c-flow__items--thanks .c-flow__item:last-child {
    flex-basis: auto;
    min-height: 0;
    padding: 32px 24px 56px;
    background: none;
  }

  .c-flow__items--thanks .c-flow__item:last-child {
    padding-bottom: 32px;
  }

  .c-flow__items--thanks .c-flow__item + .c-flow__item {
    padding-top: 46px;
  }

  .c-flow__items--thanks .c-flow__head {
    gap: 8px;
  }

  .c-flow__items--thanks {
    background: var(--color-white);
  }
}

@media (max-width: 768px) {
  .p-entry {
    gap: 48px;
    padding-block: 64px 120px;
  }

  .p-entry-step,
  .p-thanks {
    gap: 40px;
  }

  .p-entry__lead br {
    display: none;
  }

  .p-entry-form {
    gap: 40px;
  }

  .p-entry-form__fields {
    gap: 40px;
    padding-block: 40px;
    border-top: 1px solid var(--color-line);
  }

  .p-entry-field,
  .p-entry-sub {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .p-entry-field__label,
  .p-entry-field:has(.p-entry-field__selects) .p-entry-field__label {
    min-height: 0;
  }

  legend.p-entry-field__label {
    float: none;
    width: auto;
    margin-bottom: 16px;
  }

  .p-entry-field:has(.p-entry-field__checks) legend.p-entry-field__label {
    margin-bottom: 24px;
  }

  .p-entry-field__req {
    align-self: flex-start;
    margin-top: 8px;
    font-size: 10px;
    line-height: 1;
  }

  .p-entry-field__control {
    gap: 16px;
  }

  .p-entry-field__checks {
    gap: 16px 0;
    margin-bottom: 0;
  }

  .c-check {
    font-size: 14px;
  }

  .c-input {
    min-height: 60px;
    padding: 15px 16px;
  }

  .p-entry-field__selects {
    flex-direction: column;
    gap: 16px;
  }

  .c-select__input {
    flex: 1;
    width: auto;
    height: 62px;
    padding: 16px 40px 16px 16px;
    background-position: right 16px center;
  }

  .p-entry-field__control--sub {
    gap: 16px;
  }

  .c-check--policy {
    gap: 8px;
    padding-inline: 20px;
    font-size: 14px;
  }

  .p-entry-form__policy-link {
    border-bottom: 0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 7px;
    transition: text-decoration-color var(--duration) var(--ease);
  }

  .p-entry-form__policy-link:hover {
    text-decoration-color: transparent;
  }

  .c-button--lg,
  .p-entry-confirm__buttons .c-button {
    width: 100%;
    min-height: 60px;
    padding-block: 20px;
  }

  .p-entry-confirm__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding-block: 24px;
    font-size: 14px;
  }

  .p-entry-confirm__buttons {
    flex-direction: column;
    gap: 8px;
  }

  .p-entry-confirm__buttons .c-button {
    min-height: 68px;
  }

  .p-entry-confirm__buttons .c-button--back {
    justify-content: flex-start;
  }

  .p-thanks__title {
    font-size: 28px;
    line-height: 1.5;
  }

  .p-thanks__flow-title {
    font-size: 22px;
  }

  .p-thanks__flow {
    gap: 28px;
    align-self: stretch;
    width: auto;
    margin-inline: calc(var(--gutter) * -1);
    padding: 30px var(--gutter) 26px;
    border-radius: 0;
  }

  .c-flow__items--thanks .c-flow__item:first-child {
    padding-top: 30px;
  }

  .c-flow__items--thanks .c-flow__item:last-child {
    padding-bottom: 30px;
  }

  .p-thanks .c-button--lg {
    width: 100%;
    min-height: 68px;
  }
}
