:root {
  --xiaomi-orange: #ff6900;
  --xiaomi-orange-dark: #e95f00;
  --cosmic-black: #191919;
  --high-tech-silver: #898989;
  --reverse-white: #ffffff;
  --page-bg: #f4f6f8;
  --line: #dfe3e8;
  --danger: #b42318;
  --success: #10805f;
  --shadow: 0 18px 45px rgba(25, 25, 25, 0.12);
  --radius: 8px;
  --max-width: 1180px;
}

@font-face {
  font-family: "MiSans";
  src: url("../../assets/fonts/01%20MiSans%20Latin%20VF/01%20MiSans%20Latin%20VF/MiSans%20Latin.woff/MiSansLatin-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MiSans";
  src: url("../../assets/fonts/01%20MiSans%20Latin%20VF/01%20MiSans%20Latin%20VF/MiSans%20Latin.woff/MiSansLatin-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
}

body {
  margin: 0;
  font-family: "MiSans", Arial, Helvetica, sans-serif;
  color: var(--cosmic-black);
  background: var(--page-bg);
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  overflow: hidden;
}

.hero {
  position: relative;
  aspect-ratio: 750 / 840;
  height: auto;
  background: var(--xiaomi-orange);
  overflow: hidden;
}

.hero__picture,
.hero__image {
  display: block;
  width: 100%;
  height: 100%;
}

.hero__image {
  object-fit: cover;
  object-position: top center;
}

.mi-mark {
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.mi-mark--small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--xiaomi-orange);
  color: var(--reverse-white);
  font-size: 18px;
}

.form-section {
  position: relative;
  z-index: 3;
  width: min(calc(100% - 28px), var(--max-width));
  margin: 28px auto 0;
}

.activation-card,
.benefits {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(223, 227, 232, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.activation-card {
  padding: 28px 18px 24px;
}

.card-header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.card-header__icon {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: #fff2e8;
  color: var(--xiaomi-orange);
}

.card-header__icon svg,
.field-icon svg,
.submit-button svg,
.dropzone svg,
.benefits svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-header h2 {
  margin: 0;
  font-size: 1.22rem;
  line-height: 1.1;
}

.card-header p {
  margin: 8px 0 0;
  color: #555d66;
  font-size: 0.95rem;
}

.form-alert {
  margin: 16px 0 0 62px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: var(--radius);
  background: #fff3f1;
  color: var(--danger);
  font-weight: 700;
}

.field-grid {
  display: grid;
  gap: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.field-icon {
  display: grid;
  min-height: 52px;
  place-items: center;
  color: var(--xiaomi-orange);
  font-weight: 800;
}

.field-icon--imei {
  overflow: hidden;
  font-size: 1.9rem;
  letter-spacing: 2px;
}

.field {
  position: relative;
  display: grid;
  gap: 9px;
  min-width: 0;
}

.field > span,
.field label {
  font-weight: 700;
}

.field input,
.field select {
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--reverse-white);
  color: var(--cosmic-black);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field select:disabled {
  color: #8d96a0;
  background: #f8fafb;
}

.field input:focus,
.field select:focus,
.dropzone:focus-within {
  border-color: var(--xiaomi-orange);
  box-shadow: 0 0 0 4px rgba(255, 105, 0, 0.14);
}

.field--with-counter input {
  padding-right: 62px;
}

.counter {
  position: absolute;
  right: 16px;
  top: 43px;
  color: #737b84;
  font-size: 0.92rem;
}

.city-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 20;
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(255, 105, 0, 0.22);
  border-radius: var(--radius);
  background: var(--reverse-white);
  box-shadow: 0 16px 34px rgba(25, 25, 25, 0.14);
}

.city-option {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--cosmic-black);
  text-align: left;
  cursor: pointer;
}

.city-option:hover,
.city-option.is-active {
  background: #fff2e8;
  color: var(--xiaomi-orange);
}

.city-option--empty {
  display: grid;
  align-items: center;
  color: #707982;
  cursor: default;
}

.city-option--empty:hover {
  background: transparent;
  color: #707982;
}

.field-help,
.field-note,
.field-error {
  font-size: 0.86rem;
  line-height: 1.35;
}

.field-help,
.field-note {
  color: #5e6670;
}

.field-error {
  min-height: 0;
  color: var(--danger);
  font-weight: 700;
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid .dropzone {
  border-color: var(--danger);
}

.dropzone {
  display: grid;
  min-height: 122px;
  place-items: center;
  padding: 20px 16px;
  border: 1px dashed #cfd6dd;
  border-radius: var(--radius);
  color: var(--xiaomi-orange);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.dropzone:hover {
  background: #fff8f2;
}

.dropzone strong {
  margin-top: 8px;
  color: #505860;
  font-size: 0.98rem;
}

.dropzone span {
  margin-top: 4px;
  color: #707982;
  font-size: 0.84rem;
}

.privacy-check {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-left: 62px;
  color: #3b4148;
  line-height: 1.35;
}

.privacy-check input {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--xiaomi-orange);
}

.privacy-error {
  margin-left: 62px;
}

.submit-button {
  display: inline-flex;
  width: calc(100% - 62px);
  min-height: 58px;
  margin: 24px 0 0 62px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--xiaomi-orange-dark), var(--xiaomi-orange));
  color: var(--reverse-white);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(255, 105, 0, 0.26);
  transition: transform 160ms ease, opacity 160ms ease;
}

.submit-button:hover {
  transform: translateY(-1px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.submit-button__icon svg {
  width: 24px;
  height: 24px;
}

.benefits {
  display: grid;
  gap: 0;
  margin: 24px 0 0;
  overflow: hidden;
}

.benefits div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.benefits div:last-child {
  border-bottom: 0;
}

.benefits span {
  display: grid;
  place-items: center;
  color: var(--xiaomi-orange);
}

.benefits svg {
  width: 32px;
  height: 32px;
}

.benefits p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.25;
}

.site-footer {
  display: grid;
  width: min(calc(100% - 40px), var(--max-width));
  margin: 28px auto 32px;
  gap: 14px;
  align-items: center;
  color: #68717b;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-footer strong,
.site-footer p:last-child {
  color: var(--xiaomi-orange);
}

.success-modal {
  width: min(calc(100% - 32px), 420px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.success-modal::backdrop {
  background: rgba(25, 25, 25, 0.56);
}

.success-modal__body {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 34px 24px;
  place-items: center;
  text-align: center;
}

.success-modal h2 {
  margin: 0;
  font-size: 1.35rem;
}

.success-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  background: #e9fff7;
  color: var(--success);
  font-size: 2rem;
  font-weight: 800;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #68717b;
  font-size: 1.6rem;
  cursor: pointer;
}

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

@media (min-width: 720px) {
  .hero {
    aspect-ratio: 1280 / 760;
  }

  .activation-card {
    padding: 38px 42px 34px;
  }

  .benefits {
    grid-template-columns: repeat(4, 1fr);
  }

  .benefits div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .benefits div:last-child {
    border-right: 0;
  }

  .site-footer {
    grid-template-columns: auto 1fr auto;
    text-align: left;
  }
}

@media (min-width: 1040px) {
  .hero {
    aspect-ratio: 1920 / 640;
  }

  .form-section {
    margin-top: 36px;
  }
}

@media (max-width: 560px) {
  .hero {
    aspect-ratio: 750 / 840;
  }

  .field-row {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .field-icon {
    min-height: 50px;
  }

  .form-alert,
  .privacy-check,
  .privacy-error,
  .submit-button {
    margin-left: 44px;
  }

  .submit-button {
    width: calc(100% - 44px);
  }
}
