/* MT5 Trading — mobile-first setup panel */
.lp-mt5 .lp-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  min-height: 100vh;
  padding-top: calc(4.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  overflow: visible;
  box-sizing: border-box;
}

.lp-mt5 .mt5-hero {
  width: 100%;
  padding: 0.85rem 0 1.1rem;
}

.lp-mt5 .mt5-hero__inner {
  text-align: center;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.lp-mt5 .mt5-hero .lp-badge {
  margin-bottom: 0.65rem;
  font-size: 0.68rem;
}

.lp-mt5 .mt5-hero h1 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  color: var(--lp-text);
}

.lp-mt5 .mt5-hero h1 span {
  color: var(--lp-green-dark);
  font-weight: 700;
}

.lp-mt5 .mt5-hero__lead {
  margin: 0 auto;
  max-width: 22rem;
  color: var(--lp-text-2);
  line-height: 1.55;
  font-size: 0.9rem;
  text-align: center;
}

.lp-mt5 .mt5-packs {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0.15rem 0 1.5rem;
  overflow: visible;
}

.lp-mt5 .mt5-shell {
  width: 100%;
  max-width: 34rem;
  margin-left: auto;
  margin-right: auto;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
}

.lp-mt5 .mt5-source-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.lp-mt5 .mt5-source-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lp-text-3);
  text-align: left;
}

.lp-mt5 .mt5-source-label span {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: #6ea8fe;
}

.lp-mt5 .mt5-panel {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: var(--lp-white);
  box-shadow:
    0 1px 2px rgba(21, 36, 32, 0.04),
    0 12px 28px rgba(21, 36, 32, 0.05);
  overflow: visible;
}

.lp-mt5 .mt5-panel__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  gap: 0.55rem;
  padding: 0.95rem 0.9rem 0.85rem;
  border-bottom: 1px solid var(--lp-line);
  background: linear-gradient(180deg, var(--lp-bg) 0%, var(--lp-white) 100%);
}

.lp-mt5 .mt5-panel__eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--lp-text-3);
}

.lp-mt5 .mt5-panel__brand {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--lp-text);
}

.lp-mt5 .mt5-panel__tag {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--lp-text-2);
}

.lp-mt5 .mt5-panel__desc {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--lp-text-3);
}

.lp-mt5 .mt5-panel__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.22rem;
  border-radius: 10px;
  border: 1px solid var(--lp-line);
  background: var(--lp-white);
  box-shadow: none;
}

.lp-mt5 .mt5-ai-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  margin: 0;
  min-height: 2.55rem;
  padding: 0.32rem 0.25rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lp-text-3);
  font-family: inherit;
  cursor: pointer;
  opacity: 1;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lp-mt5 .mt5-ai-pick strong {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: inherit;
}

.lp-mt5 .mt5-ai-pick em {
  font-style: normal;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
}

.lp-mt5 .mt5-ai-pick:hover {
  background: var(--lp-green-50, #f4fbf7);
  color: var(--lp-green-dark, #16a34a);
}

.lp-mt5 .mt5-ai-pick.is-active {
  background: var(--lp-green, #22c55e);
  color: #fff;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.28);
}

.lp-mt5 .mt5-ai-pick.is-active em {
  opacity: 0.9;
}

.lp-mt5 .mt5-ai-pick.is-locked,
.lp-mt5 .mt5-ai-pick:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  color: var(--lp-text-3, #7a8a84);
  background: rgba(255,255,255,0.06);
  box-shadow: none;
}

.lp-mt5 .mt5-ai-pick.is-locked:hover,
.lp-mt5 .mt5-ai-pick:disabled:hover {
  background: rgba(255,255,255,0.06);
  color: var(--lp-text-3, #7a8a84);
}

.lp-mt5 .mt5-ai-pick.is-locked.is-active,
.lp-mt5 .mt5-ai-pick:disabled.is-active {
  background: rgba(255,255,255,0.08);
  color: var(--lp-text-3, #7a8a84);
  box-shadow: none;
}

.lp-mt5 .mt5-ai-pick__lock {
  display: block;
  width: 14px;
  height: 14px;
  margin-top: 0.1rem;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7c75' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
}

.lp-mt5 .mt5-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.1rem 1rem 1.25rem;
  background: var(--lp-white);
}

.lp-mt5 .mt5-form__section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lp-mt5 .mt5-form__label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--lp-text-3);
}

/* Mobile: luôn 1 cột — dễ nhập */
.lp-mt5 .mt5-form__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.lp-mt5 .mt5-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  text-align: left;
  min-width: 0;
  width: 100%;
}

.lp-mt5 .mt5-field > span:first-child {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lp-text-2);
}

.lp-mt5 .mt5-field__hint {
  margin: 0;
  font-size: 0.72rem;
  color: var(--lp-text-3);
  line-height: 1.45;
}

.lp-mt5 .mt5-input {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  width: 100%;
  min-height: 3rem;
  border: 1px solid #d5d8dc;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  padding-left: 0.85rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lp-mt5 .mt5-input em {
  flex-shrink: 0;
  font-style: normal;
  font-weight: 700;
  color: #6b7280;
  font-size: 0.95rem;
}

.lp-mt5 .mt5-input input {
  flex: 1;
  width: 100%;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.75rem 0.75rem 0.75rem 0.3rem;
  color: var(--lp-text);
  min-height: 3rem;
  /* 16px — tránh Safari auto-zoom khi focus */
  font-size: 16px !important;
}

.lp-mt5 .mt5-input:focus-within {
  border-color: var(--lp-green);
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.lp-mt5 .mt5-field--full {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.lp-mt5 .mt5-field input,
.lp-mt5 .mt5-field select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #d5d8dc;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: var(--lp-text);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lp-mt5 .mt5-field input::placeholder {
  color: #9ca3af;
}

.lp-mt5 .mt5-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.4 0.6L6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-color: rgba(255, 255, 255, 0.08);
  padding-right: 2.35rem;
  cursor: pointer;
  font-weight: 700;
  color: var(--lp-text);
}

.lp-mt5 .mt5-field select:disabled {
  opacity: 0.8;
  cursor: not-allowed;
  color: #9ca3af;
  font-weight: 500;
}

.lp-mt5 .mt5-field input:focus,
.lp-mt5 .mt5-field select:focus {
  border-color: var(--lp-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
  background: rgba(255,255,255,0.08);
}

.lp-mt5 .mt5-pw-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.lp-mt5 .mt5-pw-wrap input {
  padding-right: 2.75rem;
}

.lp-mt5 .mt5-toggle-pw {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.lp-mt5 .mt5-toggle-pw::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M15 12a3 3 0 11-6 0 3 3 0 016 0z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z'/%3E%3C/svg%3E");
}

.lp-mt5 .mt5-toggle-pw.is-visible::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21'/%3E%3C/svg%3E");
}

.lp-mt5 .mt5-toggle-pw:hover {
  opacity: 1;
  background: rgba(34, 197, 94, 0.1);
}

.lp-mt5 .mt5-form__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.15rem;
  margin-top: 0.1rem;
  padding: 0.9rem 1rem;
  border: 0;
  border-radius: 12px;
  background: var(--lp-green);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lp-mt5 .mt5-form__btn:hover,
.lp-mt5 .mt5-form__btn:active {
  background: var(--lp-green-dark);
}

.lp-mt5 .mt5-form__msg {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  font-size: 0.84rem;
  line-height: 1.4;
}

.lp-mt5 .mt5-form__msg.is-ok {
  background: var(--lp-green-50);
  color: var(--lp-green-dark);
  border: 1px solid var(--lp-green-200);
}

.lp-mt5 .mt5-form__msg.is-err {
  background: rgba(224,112,112,0.12);
  color: #9b2c2c;
  border: 1px solid #f0c4c0;
}

.lp-mt5 .mt5-pending {
  margin-top: 0.25rem;
  padding: 1.15rem 1rem 1.25rem;
  border-radius: 14px;
  background: var(--lp-green-50);
  border: 1px solid var(--lp-green-200);
  text-align: center;
}

.lp-mt5 .mt5-pending__badge {
  display: inline-block;
  margin: 0 0 0.65rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--lp-white);
  border: 1px solid var(--lp-green-200);
  color: var(--lp-green-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lp-mt5 .mt5-pending__title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--lp-ink);
}

.lp-mt5 .mt5-pending__lead {
  margin: 0 auto;
  max-width: 28rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--lp-muted, #5b6470);
}

.lp-mt5 .mt5-pending__lead strong {
  color: var(--lp-green-dark);
  font-weight: 700;
}

.lp-mt5 .mt5-pending__meta {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--lp-ink);
}

.lp-mt5 .mt5-pending__redirect {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lp-green-dark);
}

.lp-mt5 .mt5-pending__again {
  margin-top: 1rem;
  width: 100%;
  max-width: 16rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--lp-green-200);
  border-radius: 10px;
  background: var(--lp-white);
  color: var(--lp-green-dark);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.lp-mt5 .mt5-pending__again:hover,
.lp-mt5 .mt5-pending__again:active {
  background: var(--lp-green-50);
}

.lp-mt5 .mt5-panel.is-pending .mt5-form {
  display: none;
}

.lp-mt5 .mt5-form.is-busy .mt5-form__btn {
  opacity: 0.7;
  pointer-events: none;
}

.lp-mt5 .mt5-footnote {
  margin: 1rem auto 0;
  padding: 0 0.25rem;
  text-align: center;
  max-width: 22rem;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--lp-text-3);
}

/* Tablet+ : 2 cột form, panel rộng hơn */
@media (min-width: 640px) {
  .lp-mt5 .lp-main {
    padding-top: calc(4.75rem + env(safe-area-inset-top, 0px));
  }

  .lp-mt5 .mt5-hero {
    padding: 1.25rem 0 1.5rem;
  }

  .lp-mt5 .mt5-hero__lead {
    max-width: 28rem;
    font-size: 0.98rem;
  }

  .lp-mt5 .mt5-panel {
    border-radius: 18px;
  }

  .lp-mt5 .mt5-panel__head {
    padding: 1.05rem 1.25rem 0.95rem;
  }

  .lp-mt5 .mt5-panel__brand {
    font-size: 1.5rem;
  }

  .lp-mt5 .mt5-panel__desc {
    font-size: 0.8rem;
  }

  .lp-mt5 .mt5-panel__meta {
    max-width: 24rem;
  }

  .lp-mt5 .mt5-ai-pick {
    min-height: 2.65rem;
  }

  .lp-mt5 .mt5-form {
    gap: 1.35rem;
    padding: 1.3rem 1.4rem 1.5rem;
  }

  .lp-mt5 .mt5-form__row {
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
  }

  .lp-mt5 .mt5-footnote {
    max-width: 28rem;
    font-size: 0.76rem;
  }
}

/* Màn hẹp ≤380px */
@media (max-width: 380px) {
  .lp-mt5 .mt5-panel__head,
  .lp-mt5 .mt5-form {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .lp-mt5 .mt5-panel__meta span,
  .lp-mt5 .mt5-ai-pick {
    font-size: inherit;
  }

  .lp-mt5 .mt5-ai-pick {
    min-height: 2.4rem;
    padding: 0.28rem 0.2rem;
  }
}
