/* Contract types + standard templates merged page. PSD section 8 is the visual source. */

.contract-types-page {
  --ct-base: #fdfbf8;
  --ct-blue: #0054ff;
  --ct-blue-soft: #edf4ff;
  --ct-yellow: #ffc400;
  --ct-ink: #171717;
  --ct-muted: #626b78;
  --ct-line: #dfe3e9;
  --ct-paper: #fbfbfd;
  overflow-x: clip;
  background: var(--ct-base);
  color: var(--ct-ink);
}

.contract-types-page main {
  overflow: clip;
}

.contract-types-page [hidden] {
  display: none !important;
}

.ct-page {
  font-family: var(--sd-font-sans);
}

.ct-shell {
  width: min(calc(100% - 64px), 1312px);
  margin-inline: auto;
}

.ct-blue {
  color: var(--ct-blue);
}

.ct-page-hero {
  position: relative;
  min-height: 810px;
  padding: 34px 0 82px;
  background: var(--ct-base);
}

.ct-page-hero__documents {
  width: 100%;
  overflow: hidden;
}

.ct-document-carousel {
  position: relative;
  width: 100%;
  height: 370px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  cursor: ew-resize;
  outline: none;
  scroll-behavior: auto;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.ct-document-carousel::-webkit-scrollbar {
  display: none;
}

.ct-document-carousel:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(0, 84, 255, .24);
}

.ct-document-carousel__track {
  display: flex;
  width: max-content;
  min-width: 100%;
  min-height: 100%;
  gap: 34px;
  align-items: center;
  padding: 40px max(32px, calc(50vw - 82px)) 34px;
}

.ct-document-card {
  --ct-document-focus: 0;
  --ct-document-rotation: 0deg;
  position: relative;
  display: grid;
  width: 164px;
  height: 270px;
  flex: 0 0 164px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(47, 54, 68, .22);
  border-radius: 3px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(249, 249, 247, .98)),
    #fff;
  box-shadow:
    0 10px 24px rgba(24, 35, 62, .1),
    0 2px 5px rgba(24, 35, 62, .08);
  color: #1b1b1b;
  scroll-snap-align: center;
  transform:
    translateY(calc((1 - var(--ct-document-focus)) * 22px))
    rotate(var(--ct-document-rotation))
    scale(calc(.84 + (var(--ct-document-focus) * .36)));
  transform-origin: center;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
  will-change: transform;
}

.ct-document-card::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 34px;
  height: 34px;
  border-bottom: 1px solid rgba(47, 54, 68, .12);
  border-left: 1px solid rgba(47, 54, 68, .12);
  background: linear-gradient(225deg, #eef0f4 0 49%, #fff 51%);
  content: "";
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.ct-document-card::after {
  position: absolute;
  right: 18px;
  bottom: 18px;
  left: 18px;
  height: 1px;
  background: rgba(0, 84, 255, .22);
  content: "";
}

.ct-document-card.is-centered {
  z-index: 3;
  border-color: rgba(0, 84, 255, .38);
  box-shadow:
    0 24px 46px rgba(24, 49, 105, .2),
    0 5px 12px rgba(24, 35, 62, .1);
  color: var(--ct-blue);
}

.ct-document-card__number {
  position: absolute;
  top: 16px;
  left: 15px;
  color: #87909e;
  font-family: var(--sd-font-sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.ct-document-card__name {
  display: block;
  max-width: 108px;
  max-height: 198px;
  overflow: hidden;
  font-family: "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "Batang", serif;
  font-size: var(--ct-document-name-size, 22px);
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-orientation: mixed;
  word-break: keep-all;
  writing-mode: vertical-rl;
}

.ct-page-hero__content {
  display: grid;
  justify-items: center;
  padding-top: 8px;
}

.ct-page-hero__copy {
  position: relative;
  z-index: 2;
  margin-top: 46px;
  text-align: center;
}

.ct-page-hero h1 {
  max-width: 650px;
  margin: 0;
  color: #000;
  font-size: 58px;
  font-weight: 900;
  line-height: 1.18;
}

.ct-page-hero h1 span {
  display: block;
  white-space: nowrap;
}

.ct-page-hero h1 strong {
  color: var(--ct-blue);
  font-size: 1.28em;
  font-weight: inherit;
}

.ct-page-hero__lead {
  max-width: 580px;
  margin: 26px auto 0;
  color: #292929;
  font-size: 18px;
  font-weight: 560;
  line-height: 1.7;
}

.ct-search {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 76px;
  border: 1px solid rgba(26, 44, 83, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 16px 42px rgba(29, 53, 105, .16);
}

.ct-search svg {
  flex: 0 0 auto;
  margin-left: 24px;
  color: #657080;
}

.ct-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ct-ink);
  font: inherit;
  font-size: 17px;
}

.ct-search input::placeholder {
  color: #7a8492;
}

.ct-search input:focus-visible {
  outline: 0;
}

.ct-search:focus-within {
  border-color: rgba(7, 85, 247, .55);
  box-shadow:
    0 16px 42px rgba(29, 53, 105, .16),
    0 0 0 4px rgba(7, 85, 247, .12);
}

.ct-search--hero {
  width: min(620px, 100%);
}

.ct-featured {
  padding: 68px 0 96px;
  background: var(--ct-base);
}

.ct-section-heading {
  margin: 0;
  color: var(--ct-ink);
  font-size: 42px;
  font-weight: 850;
  line-height: 1.25;
}

.ct-section-copy {
  max-width: 660px;
  margin: 12px 0 0;
  color: var(--ct-muted);
  font-size: 17px;
  line-height: 1.65;
}

.ct-featured__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.ct-feature-card {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid #bfc5ce;
  border-radius: 8px;
  background: #fff;
}

.ct-feature-card__copy {
  position: relative;
  z-index: 3;
  padding: 22px 20px;
}

.ct-feature-card h3 {
  margin: 0;
  color: #222;
  font-size: 25px;
  font-weight: 850;
  line-height: 1.25;
}

.ct-feature-card p {
  max-width: 240px;
  margin: 12px 0 0;
  color: #555f6b;
  font-size: 14px;
  font-weight: 540;
  line-height: 1.55;
}

.ct-feature-card__link {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ct-blue);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.ct-feature-card__link::before {
  margin-right: 7px;
  content: "→";
  transition: transform 180ms ease;
}

.ct-feature-card__link:hover {
  text-decoration: none;
}

.ct-feature-card__link:hover::before {
  transform: translateX(4px);
}

.ct-feature-card__visual {
  position: absolute;
  right: -6%;
  bottom: -4%;
  z-index: 1;
  width: 78%;
  max-height: 72%;
  object-fit: contain;
  object-position: right bottom;
  filter: drop-shadow(0 14px 18px rgba(26, 39, 70, .12));
}

.ct-feature-card--lease .ct-feature-card__visual {
  right: -12%;
  bottom: -10%;
  width: 94%;
  max-height: 76%;
}

.ct-feature-card--service .ct-feature-card__visual {
  right: -10%;
  bottom: -2%;
  width: 92%;
}

.ct-feature-card--agreement .ct-feature-card__visual {
  right: -10%;
  width: 88%;
}

.ct-library {
  padding: 82px 0 110px;
  background: #fafbfe;
  border-top: 1px solid rgba(31, 42, 67, .07);
  border-bottom: 1px solid rgba(31, 42, 67, .07);
}

.ct-library__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
}

.ct-library__head-copy {
  min-width: 0;
}

.ct-library__head .ct-search {
  flex: 0 0 380px;
  min-height: 56px;
  box-shadow: 0 8px 24px rgba(29, 53, 105, .08);
}

.ct-library__head .ct-search svg {
  margin-left: 18px;
}

.ct-library__head .ct-search input {
  font-size: 15px;
}

.ct-library__status {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--ct-blue);
  font-size: 14px;
  font-weight: 700;
}

.ct-library__layout {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 36px;
}

.ct-category-tabs {
  display: grid;
  grid-template-rows: repeat(6, 76px);
  align-self: start;
  overflow: hidden;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  background: #fff;
}

.ct-category-tab {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid #d8dce3;
  background: #fff;
  color: #20242b;
  text-align: left;
  transition: background 180ms ease, color 180ms ease;
}

.ct-category-tab:last-child {
  border-bottom: 0;
}

.ct-category-tab:hover {
  background: #f6f8fc;
}

.ct-category-tab.is-active {
  background: var(--ct-blue-soft);
  color: #151922;
}

.ct-category-tab.is-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: var(--ct-blue);
  content: "";
}

.ct-category-tab__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
}

.ct-category-tab__icon img {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.ct-category-tab__icon .ct-category-tab__check {
  display: none;
}

.ct-category-tab.is-active .ct-category-tab__icon > img:not(.ct-category-tab__check) {
  display: none;
}

.ct-category-tab.is-active .ct-category-tab__icon .ct-category-tab__check {
  display: block;
}

.ct-category-tab__label {
  min-width: 0;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.ct-category-tab__count {
  color: #6d7581;
  font-size: 13px;
  font-weight: 700;
}

.ct-template-board {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #cfd4dc;
  border-radius: 8px;
  background: #fff;
}

.ct-template-groups {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  min-height: 0;
}

.ct-template-column {
  min-width: 0;
  border-right: 1px solid #e1e4ea;
}

.ct-template-column:last-child {
  border-right: 0;
}

.ct-template-group {
  min-width: 0;
  min-height: 0;
  padding: 16px 12px;
  border-bottom: 1px solid #e1e4ea;
  background: #fff;
  transition: background 200ms ease, box-shadow 200ms ease;
}

.ct-template-column .ct-template-group:last-child {
  border-bottom: 0;
}

.ct-template-group.is-active {
  position: relative;
  z-index: 1;
  background: #eef4ff;
  box-shadow: inset 0 0 0 2px rgba(7, 85, 247, .72);
}

.ct-template-groups.is-searching {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  min-height: 0;
}

.ct-template-groups.is-searching .ct-template-column {
  display: contents;
}

.ct-template-groups.is-searching .ct-template-group {
  display: none;
}

.ct-template-groups.is-searching .ct-template-group.has-results {
  display: block;
  grid-column: auto;
  grid-row: auto;
  min-height: 0;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.ct-template-group__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 12px;
  color: #1d2532;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.ct-template-group__title span {
  color: #6d7581;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ct-template-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ct-template-item a {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: start;
  min-height: 28px;
  padding: 5px 4px;
  border-radius: 6px;
  color: #4e5663;
  text-decoration: none;
}

.ct-template-item a:hover {
  background: rgba(7, 85, 247, .08);
  color: #111827;
  text-decoration: none;
}

.ct-template-item__index {
  padding-top: 1px;
  color: #a1a8b2;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.45;
}

.ct-template-item__name {
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  word-break: keep-all;
}

.ct-template-item__action {
  overflow: hidden;
  width: 0;
  color: var(--ct-blue);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  white-space: nowrap;
  transition: width 160ms ease, opacity 160ms ease;
}

.ct-template-item a:hover .ct-template-item__action,
.ct-template-item a:focus-visible .ct-template-item__action {
  width: 24px;
  opacity: 1;
}

.ct-template-item a:focus-visible {
  outline: 2px solid var(--ct-blue);
  outline-offset: 1px;
}

.ct-library__note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 18px;
  color: #667080;
  font-size: 13px;
  line-height: 1.55;
}

.ct-library__note a {
  color: var(--ct-blue);
  font-weight: 750;
}

.ct-final {
  padding: 86px 0 96px;
  background: var(--ct-base);
}

.ct-final__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: center;
  overflow: hidden;
  min-height: 258px;
  padding: 48px 56px;
  border: 1px solid #dfe5f1;
  border-radius: 8px;
  background: #f5f8ff;
}

.ct-final h2 {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0;
  color: #111827;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.3;
}

.ct-final p {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  color: #5f6876;
  font-size: 16px;
}

.ct-final__actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 12px;
  align-items: center;
}

.ct-final__actions .btn {
  min-height: 50px;
  border-radius: 8px;
}

@media (max-width: 1279px) {
  .ct-page-hero h1 {
    font-size: 54px;
  }

  .ct-featured__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ct-feature-card {
    min-height: 340px;
  }

  .ct-library__layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 20px;
  }

  .ct-category-tab {
    padding-inline: 12px;
  }

  .ct-category-tab__label {
    font-size: 16px;
  }

  .ct-template-groups {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ct-template-group {
    min-height: 0;
    border-bottom: 1px solid #e1e4ea;
    padding: 16px 10px;
  }

  .ct-template-column .ct-template-group:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 1150px) {
  .ct-shell {
    width: min(calc(100% - 40px), 760px);
  }

  .ct-page-hero {
    min-height: 750px;
    padding-top: 30px;
  }

  .ct-page-hero h1 {
    max-width: 680px;
  }

  .ct-document-carousel {
    height: 350px;
  }

  .ct-document-carousel__track {
    gap: 28px;
    padding-top: 34px;
    padding-bottom: 30px;
  }

  .ct-library__head {
    display: block;
  }

  .ct-library__head .ct-search {
    width: 100%;
    margin-top: 24px;
  }

  .ct-library__layout {
    display: block;
  }

  .ct-category-tabs {
    grid-template-columns: repeat(6, 170px);
    grid-template-rows: 72px;
    overflow-x: auto;
    margin-bottom: 18px;
    border-radius: 8px;
    scrollbar-width: thin;
  }

  .ct-category-tab {
    min-height: 72px;
    border-right: 1px solid #d8dce3;
    border-bottom: 0;
  }

  .ct-category-tab:last-child {
    border-right: 0;
  }

  .ct-category-tab.is-active::before {
    top: auto;
    right: 0;
    width: auto;
    height: 4px;
  }

  .ct-final__inner {
    grid-template-columns: 1fr;
  }

  .ct-final__actions {
    justify-self: start;
  }
}

@media (max-width: 767px) {
  .contract-types-page .site-header {
    position: sticky;
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 70px;
    padding: 0;
    border-bottom: 1px solid rgba(23, 56, 128, .08);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 24px rgba(23, 56, 128, .08);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
  }

  .contract-types-page .site-header .nav {
    background: transparent;
  }

  .ct-shell {
    width: min(calc(100% - 32px), 520px);
  }

  .ct-page-hero {
    min-height: 0;
    padding: 20px 0 58px;
  }

  .ct-page-hero__documents {
    margin-inline: 0;
  }

  .ct-document-carousel {
    height: 286px;
    cursor: grab;
  }

  .ct-document-carousel:active {
    cursor: grabbing;
  }

  .ct-document-carousel__track {
    gap: 20px;
    padding: 24px max(16px, calc(50vw - 59px)) 22px;
  }

  .ct-document-card {
    width: 118px;
    height: 206px;
    flex-basis: 118px;
    transform:
      translateY(calc((1 - var(--ct-document-focus)) * 14px))
      rotate(var(--ct-document-rotation))
      scale(calc(.86 + (var(--ct-document-focus) * .3)));
  }

  .ct-document-card::before {
    width: 26px;
    height: 26px;
  }

  .ct-document-card::after {
    right: 13px;
    bottom: 13px;
    left: 13px;
  }

  .ct-document-card__number {
    top: 12px;
    left: 11px;
    font-size: 9px;
  }

  .ct-document-card__name {
    max-width: 80px;
    max-height: 150px;
    font-size: min(var(--ct-document-name-size, 18px), 18px);
    line-height: 1.28;
  }

  .ct-page-hero__content {
    padding-top: 6px;
  }

  .ct-page-hero__copy {
    margin-top: 34px;
  }

  .ct-page-hero h1 {
    font-size: 36px;
    line-height: 1.2;
  }

  .ct-page-hero h1 strong {
    font-size: 1.16em;
  }

  .ct-page-hero__lead {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.65;
  }

  .ct-search--hero {
    width: 100%;
  }

  .ct-search {
    min-height: 58px;
  }

  .ct-search svg {
    margin-left: 18px;
  }

  .ct-search input {
    font-size: 14px;
  }

  .ct-featured {
    padding: 54px 0 68px;
  }

  .ct-section-heading {
    font-size: 31px;
  }

  .ct-section-copy {
    font-size: 15px;
  }

  .ct-featured__grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 28px;
  }

  .ct-feature-card {
    min-height: 284px;
  }

  .ct-feature-card h3 {
    font-size: 23px;
  }

  .ct-feature-card__visual {
    width: 72%;
  }

  .ct-library {
    padding: 58px 0 72px;
  }

  .ct-library__head .ct-search {
    min-height: 54px;
  }

  .ct-category-tabs {
    grid-template-columns: repeat(6, 152px);
    margin-inline: -16px;
    padding-inline: 16px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .ct-category-tab {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .ct-category-tab__icon {
    width: 30px;
    height: 30px;
  }

  .ct-category-tab__icon img {
    width: 27px;
    height: 27px;
  }

  .ct-category-tab__count {
    display: none;
  }

  .ct-template-board {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .ct-template-groups {
    display: block;
    min-height: 0;
  }

  .ct-template-column {
    display: contents;
  }

  .ct-template-group {
    display: none;
    min-height: 0;
    padding: 18px 12px;
    border: 0;
  }

  .ct-template-group.is-active,
  .ct-template-groups.is-searching .ct-template-group.has-results {
    display: block;
  }

  .ct-template-groups.is-searching .ct-template-group,
  .ct-template-groups.is-searching .ct-template-group.is-active {
    display: none;
  }

  .ct-template-groups.is-searching .ct-template-group.has-results {
    display: block;
  }

  .ct-template-group.is-active {
    box-shadow: none;
  }

  .ct-template-group__title {
    font-size: 18px;
  }

  .ct-template-item a {
    grid-template-columns: 28px minmax(0, 1fr) 48px;
    min-height: 42px;
    padding: 10px 7px;
    border-bottom: 1px solid #edf0f4;
  }

  .ct-template-item__name {
    font-size: 14px;
  }

  .ct-template-item__action,
  .ct-template-item a:hover .ct-template-item__action,
  .ct-template-item a:focus-visible .ct-template-item__action {
    width: auto;
    opacity: 1;
    font-size: 12px;
  }

  .ct-library__note {
    display: block;
  }

  .ct-library__note a {
    display: inline-block;
    margin-top: 8px;
  }

  .ct-final {
    padding: 58px 0 calc(72px + env(safe-area-inset-bottom));
  }

  .ct-final__inner {
    min-height: 0;
    padding: 34px 26px;
  }

  .ct-final h2 {
    font-size: 31px;
  }

  .ct-final p {
    font-size: 14px;
  }

  .ct-final__actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ct-final__actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-document-card,
  .ct-feature-card__link::before,
  .ct-category-tab,
  .ct-template-group,
  .ct-template-item__action {
    transition: none;
  }
}
