/* MetaMask UI components */

.cut-corner {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    0 100%
  );
}

.cut-corner--lg {
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 24px),
    calc(100% - 24px) 100%,
    0 100%
  );
}

/* Top-right chamfer (comparison-table on metamask.io/card) */
.cut-corner-tr {
  --corner-cut: 0px;
  clip-path: polygon(
    0 0,
    calc(100% - var(--corner-cut)) 0,
    100% var(--corner-cut),
    100% 100%,
    0 100%
  );
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 44px;
  padding: 0 24px;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 0.35s var(--spring-ease, cubic-bezier(0.4, 1.35, 0.5, 0.97)),
    box-shadow 0.35s var(--spring-ease, ease),
    background 0.2s ease,
    filter 0.2s ease;
}

.btn__label {
  display: block;
  line-height: 1.2;
}

/* Connect wallet — одна подпись, без дубля при hover */
.btn-connect:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.btn-connect:active {
  transform: translateY(0);
  filter: none;
}

.btn-connect.is-connected:hover {
  filter: brightness(1.04);
}

/* MetaMask-style slide — только для маркетинговых ссылок */
.btn--slide .btn__inner,
.btn--slide .btn__hover {
  display: block;
  line-height: 1.2;
  transition: transform 0.45s cubic-bezier(0.4, 1.35, 0.5, 0.97);
}

.btn--slide:not(:hover):not(:focus-visible) .btn__hover {
  visibility: hidden;
}

.btn--slide .btn__hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(0, 110%, 0);
  pointer-events: none;
}

.btn--slide:hover .btn__inner {
  transform: translate3d(0, -110%, 0);
}

.btn--slide:hover .btn__hover {
  transform: translate3d(0, 0, 0);
  visibility: visible;
}

.btn--dark {
  background: var(--black);
  color: var(--white);
}

.btn--dark.is-connected {
  background: #15803d;
}

.btn--lime {
  background: var(--green);
  color: var(--green-dark);
}

.btn--lime.is-connected {
  background: #15803d;
  color: var(--white);
}

.btn--outline {
  background: transparent;
  color: var(--green-dark);
  box-shadow: inset 0 0 0 1.5px var(--green-dark);
}

.btn--outline:hover {
  background: rgba(1, 51, 48, 0.04);
}

.btn--link {
  background: var(--green-dark);
  color: var(--white);
}

.btn.is-busy {
  opacity: 0.55;
  cursor: wait;
  pointer-events: none;
}

.btn--lg {
  min-height: 52px;
  padding: 0 28px;
  font-size: 1.5rem;
}

.btn--sm {
  min-height: 40px;
  padding: 0 20px;
  font-size: 1.3rem;
}

.btn--block {
  width: 100%;
}

.nav-pill .btn-connect {
  flex-shrink: 0;
  min-height: 4rem;
  height: 4rem;
  padding: 0 2rem;
  font-size: 1.4rem;
}

.nav-pill__actions .lang-switcher + .btn-connect {
  margin-left: 0;
}

@media (max-width: 400px) {
  .nav-pill .btn-connect {
    padding: 0 1.4rem;
    font-size: 1.25rem;
  }

  .nav-pill .btn-connect .btn__label {
    font-size: 1.25rem;
  }
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none !important;
}

.btn:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn--slide .btn__inner,
  .btn--slide .btn__hover {
    transition: none;
  }

  .btn--slide .btn__hover {
    display: none;
  }

  .btn--slide .btn__inner {
    transform: none !important;
  }

  .btn:hover,
  .btn-connect:hover {
    transform: none;
  }

  .btn--slide:hover .btn__inner,
  .btn--slide:hover .btn__hover {
    transform: none;
  }
}

/* Section transition: features (light) → pricing (dark) — metamask "flap-top" */
.features {
  position: relative;
  z-index: 1;
}

.features::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  width: 100%;
  height: calc(6rem + 3px);
  bottom: -6rem;
  background-color: var(--green-light);
  pointer-events: none;
}

.section-flap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 2.8rem;
  margin-bottom: -1px;
  background-color: var(--green-light);
  overflow: hidden;
}

.section-flap::before {
  content: "";
  position: absolute;
  inset: -1px -1px -2px;
  background-color: var(--green-dark);
  clip-path: polygon(0 0, 35% 0, calc(35% + 3.5rem) 100%, 0 100%);
  transform: translateZ(0);
}

@media (min-width: 768px) {
  .section-flap {
    height: 4.4rem;
  }

  .section-flap::before {
    clip-path: polygon(28.5% 0, 100% 0, 100% 100%, calc(28.5% - 4.4rem) 100%);
  }
}

@media (min-width: 1200px) {
  .section-flap {
    height: 6.6rem;
  }

  .section-flap::before {
    clip-path: polygon(27% 0, 100% 0, 100% 100%, calc(27% - 6.6rem) 100%);
  }
}

/* —— Language switcher (metamask.io) —— */
.lang-switcher {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.lang-switcher__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lang-switcher__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-width: 4rem;
  min-height: 4rem;
  padding: 0 12px;
  border: none;
  border-radius: 50%;
  background: transparent;
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  transition: background 0.2s ease;
}

.lang-switcher__trigger:hover {
  background: #f3f4f6;
}

.lang-switcher__trigger:focus-visible {
  outline: 2px solid var(--green-dark);
  outline-offset: 2px;
}

/* В шапке — только глобус, напротив Connect (как metamask.io) */
.lang-switcher__trigger--icon,
.nav-pill .lang-switcher__trigger,
.page__nav .lang-switcher__trigger {
  width: 4rem;
  height: 4rem;
  min-width: 4rem;
  min-height: 4rem;
  padding: 0;
}

.lang-switcher__icon {
  display: block;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: var(--black);
}

.lang-switcher__current {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-pill .lang-switcher__current,
.page__nav .lang-switcher__current {
  display: none;
}

.lang-switcher__panel {
  position: absolute;
  z-index: 300;
  top: calc(100% + 8px);
  right: 0;
  min-width: min(100vw - 2 * var(--pad), 420px);
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(1, 51, 48, 0.14);
}

.lang-switcher__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 20px;
}

.lang-switcher__col {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lang-switcher__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-family: var(--font);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.lang-switcher__option:hover {
  background: #f3f4f6;
}

.lang-switcher__option.is-active {
  border-color: var(--green-dark);
  background: rgba(186, 242, 74, 0.12);
}

.lang-switcher__check {
  font-size: 1.2rem;
  color: var(--green-dark);
  font-weight: 700;
}
