html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow-x: hidden;
  overflow-y: auto;
}

* {
  box-sizing: border-box;
}

#amz-portal-page {
  --amz-primary: #f42657;
  --amz-primary-dark: #df1646;
  --amz-text: #050505;
  --amz-muted: #667085;
  --amz-layout-width: 1025px;
  --amz-banner-height: 220px;

  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--amz-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 86%, rgba(244, 38, 87, 0.10), transparent 34%),
    radial-gradient(circle at 95% 22%, rgba(244, 38, 87, 0.08), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fff7f9 48%, #fff1f5 100%);
}

.amz-page {
  min-height: 100dvh;
}

.amz-main {
  width: 100%;
  min-height: 100dvh;
  padding: 10px 12px 28px;
}

.amz-shell {
  width: min(var(--amz-layout-width), 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ===== Banner =====
   Banner không còn là card riêng. Nó chỉ là ảnh nằm cùng width 1025px
   với form bên dưới để tiết kiệm chiều cao và nhìn đồng bộ hơn.
*/
.amz-topbar {
  width: 100%;
  height: var(--amz-banner-height);
  min-height: var(--amz-banner-height);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.amz-banner-stage {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amz-banner {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

/* ===== Card ===== */
.amz-card {
  position: relative;
  width: 100%;
  min-height: 350px;
  background: rgba(255, 255, 255, 0.975);
  border: 1px solid rgba(244, 38, 87, 0.13);
  border-radius: 28px;
  padding: 26px 52px;
  box-shadow: 0 24px 74px rgba(31, 41, 55, 0.10);
  display: grid;
  grid-template-columns: minmax(370px, 0.94fr) minmax(310px, 0.86fr);
  align-items: center;
  column-gap: 42px;
  overflow: hidden;
}

.amz-language-row {
  position: absolute;
  top: 22px;
  right: 28px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
}

.amz-language-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(244, 38, 87, 0.28);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: 0 12px 30px rgba(31, 41, 55, 0.07);
  backdrop-filter: blur(8px);
}

.amz-language-label {
  font-size: 13px;
  font-weight: 850;
  color: var(--amz-primary);
}

.amz-language-select {
  border: none;
  outline: none;
  background: transparent;
  color: #111827;
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

.amz-content {
  min-width: 0;
  max-width: 470px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 4px;
}

.amz-logo-img {
  display: block;
  width: 118px;
  height: auto;
  margin-bottom: 20px;
}

.amz-title {
  margin: 0;
  font-size: clamp(32px, 3.1vw, 38px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #050505;
  white-space: nowrap;
  margin-bottom: 20px;
}

#amz-portal-page[data-lang="vi"] .amz-title {
  font-size: clamp(30px, 2.95vw, 36px);
  letter-spacing: -0.058em;
}

#amz-portal-page[data-lang="ja"] .amz-title {
  font-size: clamp(29px, 2.8vw, 35px);
  letter-spacing: -0.055em;
}

.amz-title-line {
  width: 88px;
  height: 5px;
  border-radius: 999px;
  background: #e60012;
  margin: 10px 0 25px;
}

.amz-form {
  width: min(100%, 470px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.amz-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.amz-label {
  font-size: clamp(16px, 1.35vw, 19px);
  font-weight: 900;
  color: #050505;
}

.amz-input {
  width: 100%;
  height: 50px;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  padding: 0 18px;
  font-size: clamp(15px, 1.25vw, 17px);
  font-weight: 650;
  color: #111827;
  background: #ffffff;
  outline: none;
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.amz-input:focus {
  border-color: var(--amz-primary);
  box-shadow: 0 0 0 4px rgba(244, 38, 87, 0.12);
}

.amz-input::placeholder {
  color: #9aa3b2;
  font-weight: 650;
}

.amz-submit {
  width: fit-content;
  min-width: 170px;
  height: 50px;
  border: none;
  border-radius: 999px;
  padding: 0 34px;
  background: var(--amz-primary);
  color: #ffffff;
  font-size: clamp(16px, 1.4vw, 19px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(244, 38, 87, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.amz-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(244, 38, 87, 0.31);
}

.amz-submit:active {
  transform: translateY(0);
  opacity: 0.92;
}

.amz-alert {
  width: min(100%, 470px);
  min-height: 44px;
  margin-top: 10px;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.amz-alert[data-visible="1"] {
  visibility: visible;
  opacity: 1;
}

.amz-alert-error {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.amz-help {
  /* width: min(100%, 500px); */
  min-width: 500px;
  padding-top: 9px;
  color: var(--amz-muted);
  font-size: clamp(13px, 1.06vw, 15px);
  line-height: 1.45;
  font-weight: 800;
}

.amz-visual {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.amz-visual-img {
  display: block;
  width: min(100%, 360px);
  max-height: 330px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 28px 46px rgba(244, 38, 87, 0.16));
}

.amz-hidden {
  display: none !important;
}

/* ===== Height-sensitive desktop screens ===== */
@media (max-height: 760px) and (min-width: 769px) {
  .amz-main {
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .amz-shell {
    gap: 10px;
  }

  .amz-card {
    min-height: 330px;
    padding-top: 22px;
    padding-bottom: 20px;
  }

  .amz-language-row {
    top: 18px;
    right: 22px;
  }

  .amz-logo-img {
    width: 104px;
    margin-bottom: 20px;
  }

  .amz-title,
  #amz-portal-page[data-lang="vi"] .amz-title,
  #amz-portal-page[data-lang="ja"] .amz-title {
    font-size: 32px;
  }

  .amz-title-line {
    width: 78px;
    height: 4px;
    margin: 8px 0 12px;
  }

  .amz-form {
    margin-top: 15px;
    gap: 10px;
  }

  .amz-input,
  .amz-submit {
    height: 46px;
  }

  .amz-alert {
    min-height: 40px;
    margin-top: 8px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .amz-help {
    padding-top: 7px;
    font-size: 13px;
  }

  .amz-visual-img {
    width: min(100%, 320px);
    max-height: 300px;
  }
}

@media (max-height: 640px) and (min-width: 769px) {
  .amz-topbar {
    height: 190px;
    min-height: 190px;
  }

  .amz-help {
    display: none;
  }

  .amz-visual-img {
    max-height: 270px;
  }
}

/* ===== Tablet ===== */
@media (max-width: 1024px) {
  #amz-portal-page {
    --amz-layout-width: 100%;
    --amz-banner-height: 190px;
  }

  .amz-card {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.68fr);
    column-gap: 22px;
    padding: 28px 30px;
  }

  .amz-title,
  #amz-portal-page[data-lang="vi"] .amz-title,
  #amz-portal-page[data-lang="ja"] .amz-title {
    font-size: 30px;
  }

  .amz-visual-img {
    max-height: 300px;
  }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  #amz-portal-page {
    --amz-banner-height: 120px;
  }

  .amz-main {
    min-height: 100dvh;
    padding: 8px 10px 12px;
  }

  .amz-shell {
    gap: 8px;
  }

  .amz-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    row-gap: 8px;
    border-radius: 22px;
    padding: 14px 16px 16px;
  }

  .amz-language-row {
    position: relative;
    top: auto;
    right: auto;
    order: 1;
    justify-content: flex-end;
    margin-bottom: 4px;
  }

  .amz-language-box {
    min-height: 34px;
    padding: 6px 9px;
  }

  .amz-language-label {
    display: none;
  }

  .amz-language-select {
    font-size: 13px;
  }

  .amz-content {
    order: 3;
    max-width: none;
  }

  .amz-visual {
    order: 2;
    height: clamp(92px, 16dvh, 130px);
  }

  .amz-visual-img {
    width: auto;
    max-width: 78%;
    max-height: 100%;
  }

  .amz-logo-img {
    width: 86px;
    margin-bottom: 8px;
  }

  .amz-title,
  #amz-portal-page[data-lang="vi"] .amz-title,
  #amz-portal-page[data-lang="ja"] .amz-title {
    font-size: 27px;
    letter-spacing: -0.055em;
    white-space: normal;
  }

  .amz-title-line {
    width: 72px;
    height: 4px;
    margin: 8px 0 14px;
  }

  .amz-form {
    width: 100%;
    gap: 10px;
  }

  .amz-label {
    font-size: 15px;
  }

  .amz-input {
    height: 46px;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 15px;
  }

  .amz-submit {
    width: 100%;
    min-width: 0;
    height: 46px;
    font-size: 16px;
  }

  .amz-alert {
    width: 100%;
    min-height: 52px;
    margin-top: 8px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .amz-help {
    width: 100%;
    padding-top: 6px;
    font-size: 12px;
    line-height: 1.42;
  }
}
