/* Standalone branding; ordinary Pripevai button rules must not recolor this control. */
button.yandex-id-button, a.yandex-id-button {
  display:flex; align-items:center; justify-content:center; gap:16px;
  width:100%; min-height:56px; padding:12px 32px; border:0; border-radius:16px;
  background:#000; color:#fff; font:500 20px/1.2 Arial,sans-serif;
  text-decoration:none; cursor:pointer; box-shadow:none;
}
button.yandex-id-button:hover, a.yandex-id-button:hover {background:#000;color:#fff;opacity:.9}
.yandex-id-button svg {display:block; width:32px; height:32px; flex:0 0 32px}
.yandex-id-button span {color:#fff;white-space:nowrap}
.yandex-id-button:focus-visible {outline:3px solid #7384ed;outline-offset:3px}
.yandex-id-button[hidden] {display:none!important}
.yandex-id-button:disabled {opacity:.5;cursor:wait}
@media(max-width:360px){button.yandex-id-button,a.yandex-id-button{gap:12px;padding-inline:24px;font-size:18px}}

button.yandex-id-button,a.yandex-id-button{margin-block-start:16px}

button.vk-id-button {
  display:flex;align-items:center;justify-content:center;gap:8px;
  min-height:44px;border:0;border-radius:12px;color:#fff;background:#0077ff;
}
button.vk-id-button[hidden],.oauth-provider-row[hidden] {display:none!important}
button.vk-id-button svg {display:block;width:23px;height:23px;flex:0 0 23px}
button.vk-id-button:focus-visible {outline:3px solid #7384ed;outline-offset:3px}
button.vk-id-button:disabled {opacity:.5;cursor:wait}

/* Compact existing WEB auth screens when VK is available. */
body.auth-with-vk {
  min-height: 100dvh;
}
body.auth-with-vk header {
  padding-block: 10px;
}
body.auth-with-vk main {
  margin-block: clamp(10px, 3vh, 25px) 12px;
}
body.auth-with-vk .card {
  padding: clamp(15px, 2.7vw, 28px);
  min-height: 0;
}
body.auth-with-vk .record {
  width: min(280px, 100%);
  margin-block: 18px;
}
body.auth-with-vk h2 {
  margin-block: 12px 4px;
  font-size: clamp(24px, 2.4vw, 29px);
}
body.auth-with-vk #intro {
  margin-block: 0 12px;
  line-height: 1.4;
}
body.auth-with-vk #auth-form {
  display: grid;
  gap: 7px;
}
body.auth-with-vk #auth-form[hidden] {
  display: none;
}
body.auth-with-vk #auth-form > label {
  margin: 0;
}
body.auth-with-vk #auth-form label > span:first-child {
  margin: 0;
}
body.auth-with-vk #auth-form input:not([type=checkbox]),
body.auth-with-vk .password-wrap button {
  min-height: 42px;
  padding: 8px 12px;
}
body.auth-with-vk .password-wrap {
  display: flex;
  align-items: stretch;
  gap: 7px;
}
body.auth-with-vk .password-wrap input {
  min-width: 0;
}
body.auth-with-vk .password-wrap button {
  flex: 0 0 auto;
}
body.auth-with-vk .check {
  min-height: 31px;
  line-height: 1.32;
}
body.auth-with-vk .card > .secondary {
  gap: 6px;
  margin-block-start: 5px;
}
body.auth-with-vk .card > .secondary:has(> #forgot:not([hidden])) > #forgot {
  flex: 0 1 auto;
  min-height: 34px;
  padding: 5px 0;
  background: transparent;
  border-color: transparent;
  color: var(--blue);
}
body.auth-with-vk .card > .secondary:not(:has(> :not([hidden]))) {
  display: none;
}
body.auth-with-vk .storage-settings-link {
  margin-block: 0 8px;
}

.auth-modal[data-auth-with-vk] {
  padding: clamp(16px, 3vw, 29px);
  max-width: min(520px, calc(100vw - 24px));
}
.auth-modal[data-auth-with-vk] .logo {
  width: 112px;
}
.auth-modal[data-auth-with-vk] h2 {
  font-size: clamp(23px, 3.3vw, 30px);
  line-height: 1.18;
  margin: 10px 0 5px;
}
.auth-modal[data-auth-with-vk] > p {
  margin: 3px 0 8px;
  font-size: 14px;
  line-height: 1.4;
}
.auth-modal[data-auth-with-vk] .tabs {
  gap: 8px;
  margin-block: 9px 12px;
}
.auth-modal[data-auth-with-vk] .tabs button {
  min-height: 40px;
  padding-block: 8px;
}
.auth-modal[data-auth-with-vk] #design-auth-form {
  display: grid;
  gap: 7px;
  margin: 0;
}
.auth-modal[data-auth-with-vk] .field {
  margin: 0;
  gap: 4px;
}
.auth-modal[data-auth-with-vk] .field > span {
  margin: 0;
}
.auth-modal[data-auth-with-vk] .field input {
  min-height: 42px;
  padding-block: 7px;
}
.auth-modal[data-auth-with-vk] .check,
.auth-modal[data-auth-with-vk] .auth-remember-row {
  min-height: 30px;
  margin: 0;
}
.auth-modal[data-auth-with-vk] .check {
  padding-block: 5px;
}
.auth-modal[data-auth-with-vk] .primary.full {
  min-height: 44px;
  margin: 0;
  padding-block: 9px;
}
.auth-modal[data-auth-with-vk] .formerror:empty,
.auth-modal[data-auth-with-vk] > button[hidden] {
  display: none;
}
.oauth-provider-pair {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
  margin-block: 10px 2px;
}
.oauth-provider-pair > button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 12px;
  font: 600 14px/1.2 Arial,sans-serif;
  color: #fff;
  text-align: center;
}
.oauth-provider-pair .vk-id-button {
  background: #0077ff;
}
.oauth-provider-pair .yandex-id-button {
  background: #000;
}
.auth-modal[data-auth-with-vk] .oauth-provider-pair .yandex-id-button,
body.auth-with-vk .oauth-provider-pair .yandex-id-button {
  margin-block: 0 !important;
}
.oauth-provider-pair span {
  white-space: normal;
  overflow-wrap: normal;
}
.oauth-provider-pair :is(svg,img) {
  display: block;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}
@media(max-width: 420px) {
  body.auth-with-vk header {
    padding-inline: 12px;
  }
  body.auth-with-vk main {
    padding-inline: 12px;
    margin-block-start: 8px;
  }
  body.auth-with-vk .storage-settings-link {
    min-height: 30px;
    padding-block: 6px;
  }
}
@media(max-height: 620px) and (max-width: 760px) {
  body.auth-with-vk header {
    padding-block: 2px;
  }
  body.auth-with-vk main {
    margin-block: 2px;
  }
  body.auth-with-vk .card {
    padding: 10px 13px;
  }
  body.auth-with-vk h2,
  .auth-modal[data-auth-with-vk] h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  body.auth-with-vk #intro {
    margin-block: 6px 7px;
    font-size: 13px;
  }
  body.auth-with-vk #auth-form {
    gap: 4px;
  }
  body.auth-with-vk #password-help {
    font-size: 11.5px;
    line-height: 1.3;
  }
  body.auth-with-vk #submit {
    min-height: 44px;
    padding-block: 8px;
  }
  body.auth-with-vk .check {
    min-height: 24px;
  }
  body.auth-with-vk .card nav {
    padding: 2px;
  }
  body.auth-with-vk .card nav button {
    min-height: 38px;
    padding-block: 5px;
  }
  body.auth-with-vk .storage-settings-link {
    min-height: 24px;
    padding-block: 4px;
    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.4;
  }
  .auth-modal[data-auth-with-vk] {
    max-height: calc(100dvh - 16px);
    padding: 9px 15px;
  }
  .auth-modal[data-auth-with-vk] > p {
    font-size: 13px;
    margin-block: 3px 6px;
  }
  .auth-modal[data-auth-with-vk] .logo {
    width: 101px;
    margin: 0;
  }
  .auth-modal[data-auth-with-vk] .tabs {
    margin-block: 4px 6px;
  }
  .auth-modal[data-auth-with-vk] #design-auth-form {
    gap: 5px;
  }
  .auth-modal[data-auth-with-vk] .check {
    min-height: 27px;
    padding-block: 3px;
  }
}
