:root {
  --page-bg: #0f0d17;
  --card-bg: rgba(34, 22, 58, 0.96);
  --header-bg: rgba(16, 12, 28, 0.88);
  --btn-grad1: #4f6ef7;
  --btn-grad2: #7c5cfb;
  --input-bg: #f0f2f5;
  --text-main: #ffffff;
  --text-input: #1a1a2e;
  --card-radius: 22px;
  --btn-radius: 14px;
  --header-radius: 18px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  color-scheme: dark;
}

html, body.mp-body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--page-bg);
  background-image: url('bg-pattern.png');
  background-repeat: repeat;
  background-size: 380px;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 16px 0;
  padding: 12px 18px;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--header-radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  z-index: 10;
}

.mp-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.mp-header-logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
}

.mp-header-menu {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

.mp-header-menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

.mp-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px 32px;
  position: relative;
  z-index: 5;
}

.mp-card {
  width: 100%;
  max-width: 420px;
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 36px 28px 28px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

@media (max-width: 480px) {
  .mp-card {
    padding: 28px 20px 24px;
  }
}

.mp-card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  letter-spacing: 0.5px;
  margin-bottom: 26px;
  line-height: 1.25;
}

.mp-phone-box {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: 14px;
  padding: 0 16px;
  height: 58px;
  margin-bottom: 14px;
}

.mp-country {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-input);
}

.mp-country-flag {
  font-size: 20px;
  line-height: 1;
}

.mp-phone-divider {
  margin: 0 10px;
  color: #c4c9d4;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.mp-phone-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 17px;
  color: var(--text-input);
  font-family: inherit;
  font-weight: 500;
}

.mp-phone-input::placeholder {
  color: #a0a8b8;
  font-weight: 400;
}

.mp-btn {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--btn-radius);
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: filter 0.2s, transform 0.2s, background 0.2s;
  outline: none;
}

.mp-btn:disabled {
  background: #2e2845;
  color: #6b6488;
  cursor: not-allowed;
}

.mp-btn.ready {
  background: linear-gradient(135deg, var(--btn-grad1), var(--btn-grad2));
  color: var(--text-main);
  box-shadow: 0 8px 28px rgba(79, 110, 247, 0.3);
}

.mp-btn.ready:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.mp-btn.ready:active {
  transform: translateY(0);
  filter: brightness(0.97);
}

.mp-terms {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.32);
  text-align: center;
  line-height: 1.7;
}

.mp-terms a {
  color: rgba(130, 170, 255, 0.6);
  text-decoration: none;
}

.mp-terms a:hover {
  color: rgba(130, 170, 255, 0.9);
}

.mp-error {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 65, 65, 0.12);
  border: 1px solid rgba(255, 65, 65, 0.25);
  border-radius: 10px;
  font-size: 13px;
  color: #ff9494;
  display: none;
  line-height: 1.5;
}

.mp-error.show {
  display: block;
}

.mp-code-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 6px;
}

.mp-code-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin-bottom: 22px;
}

.mp-otp-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.mp-otp-input {
  height: 54px;
  width: 100%;
  min-width: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.mp-otp-input:focus {
  border-color: rgba(79, 110, 247, 0.7);
  background: rgba(79, 110, 247, 0.08);
}

.mp-timer-row {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.38);
  margin-top: 8px;
}

.mp-timer-row b {
  color: rgba(180, 160, 255, 0.75);
  font-variant-numeric: tabular-nums;
}

.mp-btn-link {
  display: none;
  background: none;
  border: none;
  color: rgba(130, 170, 255, 0.65);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 10px;
  width: 100%;
  text-align: center;
}

.mp-btn-link.visible {
  display: block;
}

.mp-btn-link:hover {
  color: rgba(130, 170, 255, 0.9);
}

.mp-btn-back {
  display: block;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  margin-top: 16px;
  width: 100%;
  text-align: center;
}

.mp-btn-back:hover {
  color: rgba(255, 255, 255, 0.5);
}

.mp-password-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0 16px;
  height: 54px;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}

.mp-password-box:focus-within {
  border-color: rgba(79, 110, 247, 0.6);
  background: rgba(79, 110, 247, 0.07);
}

.mp-password-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 17px;
  font-family: inherit;
}

.mp-password-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.mp-success-wrap {
  text-align: center;
  padding: 20px 0 10px;
}

.mp-success-icon {
  font-size: 56px;
  margin-bottom: 18px;
  display: block;
}

.mp-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.mp-success-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.4);
}

.mp-view {
  display: none;
}

.mp-view.active {
  display: block;
  animation: mpFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes mpFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hidden {
  display: none !important;
}
