:root {
  --bg-page: #d9e8f1;
  --panel: #d3e8f6;
  --brand: #0669b4;
  --accent: #66c972;
  --text: #0b3a61;
  --card-border: #cfd7df;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #d6e6f0;
  color: var(--text);
}

.page-wrap {
  width: 100%;
  margin: 0;
  padding: 20px 24px 24px;
}

.screen-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.header-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.brand-group {
  display: flex;
  gap: 12px;
}

.dept-logo {
  width: 88px;
  height: 88px;
  object-fit: contain;
  flex: 0 0 auto;
}

h1 {
  margin: 6px 0 2px;
  font-size: clamp(34px, 4.8vw, 64px);
  letter-spacing: 1px;
  color: var(--brand);
  line-height: 0.98;
}

.subtitle {
  margin: 0;
  color: #0d6bb0;
  font-style: italic;
  font-size: clamp(14px, 1.6vw, 22px);
  line-height: 1.08;
  max-width: 430px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.flag-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  text-decoration: none;
  color: #5f7182;
  font-size: 16px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.flag-switch img {
  width: 34px;
  height: 22px;
  border-radius: 2px;
  object-fit: cover;
}

.login-link {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  line-height: 1;
}

.login-link::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 -5px 0 0 rgba(87, 183, 102, 0.35);
}

.logos-grid {
  margin: 2px auto 0;
  width: min(100%, 1220px);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 74px;
}

.image-grid {
  grid-template-areas:
    "saigon satra aeon mega"
    "central center center win"
    "genshai center center farmers"
    "lotte bachhoa gs25 king";
}

.logo-card {
  min-height: 74px;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 3px rgba(8, 33, 57, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
}

.logo-card img {
  max-width: 88%;
  max-height: 48px;
  object-fit: contain;
}

.saigon {
  grid-area: saigon;
}

.satra {
  grid-area: satra;
}

.aeon {
  grid-area: aeon;
}

.mega {
  grid-area: mega;
}

.central {
  grid-area: central;
}

.wincommerce {
  grid-area: win;
}

.genshai {
  grid-area: genshai;
}

.farmers {
  grid-area: farmers;
}

.kingfood {
  grid-area: king;
}

.lotte {
  grid-area: lotte;
}

.bachhoa {
  grid-area: bachhoa;
}

.gs25 {
  grid-area: gs25;
}

.center-block {
  grid-area: center;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.center-mark {
  width: 132px;
  height: 132px;
}

.center-mark img {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.logo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(8, 33, 57, 0.25);
}

.distribution {
  margin-top: 0;
  text-align: center;
  color: var(--brand);
  font-size: clamp(12px, 1.2vw, 18px);
  font-weight: 700;
  line-height: 1;
}

.login-wrap {
  min-height: calc(100vh - 58px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 12px;
  border: 1px solid #ccdae7;
  box-shadow: 0 10px 24px rgba(15, 42, 71, 0.12);
  padding: 22px;
}

.login-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-link {
  color: #0d6bb0;
  text-decoration: none;
  font-weight: 700;
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 700;
}

.lang-switch a {
  text-decoration: none;
  color: #51657b;
}

.lang-switch a.active {
  color: #c61919;
}

.login-panel h1 {
  font-size: 34px;
  margin-bottom: 6px;
}

.login-note {
  margin-top: 0;
  color: #50667a;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 5px;
  font-weight: 700;
}

.login-form input {
  height: 38px;
  border: 1px solid #c8d3de;
  border-radius: 7px;
  padding: 0 10px;
}

.login-form button {
  margin-top: 4px;
  height: 42px;
  border: 0;
  background: #80a8c9;
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  cursor: not-allowed;
}

.register-wrap {
  min-height: 100vh;
  padding-top: 28px;
}

.register-panel {
  width: min(1240px, 100%);
  margin: 0 auto;
}

.register-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.register-title {
  margin: 0 0 14px;
  color: #d51717;
  text-align: center;
  font-size: clamp(22px, 2.1vw, 30px);
  line-height: 1.1;
}

.register-grid {
  display: grid;
  grid-template-columns: 280px 1fr 330px;
  gap: 0;
  align-items: stretch;
}

.register-image {
  background: #d6e6ef;
  border: 1px solid #b6ccda;
  border-right: 0;
  min-height: 620px;
  height: 100%;
}

.register-image img {
  width: 100%;
  height: 100%;
  min-height: 620px;
  object-fit: cover;
}

.register-form-box {
  background: #cde0ed;
  border: 1px solid #b6ccda;
  border-right: 0;
  padding: 14px 14px 12px;
  height: 100%;
}

.register-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 6px 10px;
  align-items: center;
}

.register-form label {
  font-weight: 700;
  font-size: 12px;
  text-align: right;
}

.register-form input,
.register-form select {
  width: 100%;
  height: 28px;
  border: 1px solid #b7c8d6;
  border-radius: 2px;
  background: #e9f1f7;
  padding: 0 8px;
  font-size: 12px;
}

.register-divider {
  grid-column: 1 / -1;
  font-weight: 700;
  font-size: 13px;
  margin-top: 4px;
}

.register-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.delay-btn,
.register-btn,
.confirm-btn {
  border: 0;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  height: 24px;
  padding: 0 12px;
}

.delay-btn {
  background: #9ba3aa;
}

.register-btn {
  background: #0072c8;
}

.confirm-btn {
  background: #0072c8;
  margin-top: 10px;
}

.register-help {
  padding: 8px 0 0 14px;
}

.otp-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: #3d4d5e;
}

.otp-code {
  display: grid;
  grid-template-columns: repeat(6, 36px);
  gap: 6px;
}

.otp-code span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #c6d3df;
  font-size: 30px;
  font-weight: 700;
  color: #131313;
}

.register-hints {
  margin-top: 12px;
}

.register-hints p {
  margin: 0 0 5px;
  color: #d51d1d;
  font-size: 12px;
  line-height: 1.25;
}

@media (max-width: 920px) {
  .image-grid {
    grid-template-areas:
      "saigon satra"
      "aeon mega"
      "central win"
      "center center"
      "genshai farmers"
      "lotte bachhoa"
      "gs25 king";
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .dept-logo {
    width: 76px;
    height: 76px;
  }

  .logos-grid {
    grid-auto-rows: 66px;
    gap: 8px;
  }

  .logo-card {
    min-height: 66px;
  }

  .logo-card img {
    max-height: 42px;
  }

  .register-grid {
    grid-template-columns: 250px 1fr;
    gap: 10px;
  }

  .register-image {
    border-right: 1px solid #b6ccda;
  }

  .register-form-box {
    border-right: 1px solid #b6ccda;
  }

  .register-help {
    grid-column: 1 / -1;
    padding: 4px 0 0;
  }
}

@media (max-width: 680px) {
  .page-wrap {
    padding: 16px 12px 18px;
  }

  .header-row {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .flag-switch {
    font-size: 14px;
    padding: 3px 5px;
  }

  .flag-switch img {
    width: 28px;
    height: 18px;
  }

  .brand-group {
    gap: 10px;
  }

  .dept-logo {
    width: 64px;
    height: 64px;
  }

  .logos-grid {
    grid-auto-rows: 62px;
  }

  .logo-card {
    min-height: 62px;
  }

  .logo-card img {
    max-height: 38px;
  }

  .center-mark {
    width: 104px;
    height: 104px;
  }

  .center-mark img {
    width: 104px;
    height: 104px;
  }

  .register-grid {
    grid-template-columns: 1fr;
  }

  .register-image {
    min-height: 220px;
    border-right: 1px solid #b6ccda;
  }

  .register-image img {
    min-height: 220px;
  }

  .register-form-box {
    border-right: 1px solid #b6ccda;
    padding: 12px;
  }

  .register-form {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .register-form label {
    text-align: left;
  }

  .register-actions {
    justify-content: stretch;
  }

  .delay-btn,
  .register-btn,
  .confirm-btn {
    flex: 1;
  }

  .otp-code {
    grid-template-columns: repeat(6, minmax(30px, 1fr));
  }

  .otp-code span {
    width: auto;
    height: 34px;
    font-size: 24px;
  }
}
