:root {
  --mg-navy: #071a2f;
  --mg-navy-2: #0b2441;
  --mg-green: #1f8a5b;
  --mg-green-light: #38c786;
  --mg-green-pale: #eef9f3;
  --mg-blue: #2457f5;
  --mg-text: #111827;
  --mg-muted: #667085;
  --mg-line: #d9e2ec;
  --mg-danger: #b42318;
  --mg-danger-soft: #fff2f0;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--mg-text);
  background:
    radial-gradient(circle at 4% 12%, rgba(71, 141, 222, 0.22), transparent 28%),
    radial-gradient(circle at 94% 88%, rgba(91, 75, 218, 0.14), transparent 30%),
    #f3f7fc;
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

.mg-login-page {
  width: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
}

.mg-login-shell {
  width: min(100%, 1320px);
  height: min(760px, calc(100vh - 32px));
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(430px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(203, 213, 225, 0.95);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(30, 64, 116, 0.14);
}

/* VISUAL PANEL */
.mg-visual-panel {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 22px 34px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 73% 45%, rgba(36, 130, 94, 0.25), transparent 27%),
    radial-gradient(circle at 56% 13%, rgba(30, 78, 123, 0.45), transparent 35%),
    linear-gradient(138deg, #06182d 0%, #09213c 54%, #0c2e3a 100%);
}

.mg-grid-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

.mg-visual-panel::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  left: 50%;
  top: 45%;
  border: 1px solid rgba(55, 199, 134, 0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 58px rgba(55, 199, 134, 0.025),
    0 0 0 116px rgba(55, 199, 134, 0.018);
}

.mg-visual-panel::after {
  content: "";
  position: absolute;
  right: -150px;
  bottom: -180px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(32, 145, 96, 0.08);
  filter: blur(4px);
}

.mg-login-badge {
  position: relative;
  z-index: 5;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.mg-login-badge span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mg-green-light);
  box-shadow: 0 0 0 5px rgba(56, 199, 134, 0.15);
}

.mg-mobile-copy-group {
  display: contents;
}

.mg-scene {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 460px;
  height: 430px;
  transform: translate(-50%, -50%);
}

.mg-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  border: 1px solid rgba(79, 204, 147, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.mg-orbit-one {
  width: 290px;
  height: 290px;
}

.mg-orbit-two {
  width: 360px;
  height: 360px;
  border-style: dashed;
}

.mg-orbit-three {
  width: 215px;
  height: 215px;
  border-color: rgba(79, 204, 147, 0.22);
}

.mg-portal-mark {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 220px;
  height: 230px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 32px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.18), rgba(36, 87, 245, 0.06)),
    rgba(11, 37, 62, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 28px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(15px);
  transform: translate(-50%, -50%);
}

.mg-mark-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 23px;
  color: #fff;
  background: linear-gradient(145deg, #20a368, #38c786);
  box-shadow: 0 18px 42px rgba(25, 174, 109, 0.28);
  font-size: 40px;
}

.mg-portal-mark strong {
  font-size: 22px;
  letter-spacing: 0.015em;
}

.mg-portal-mark > span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.mg-orb {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.4), rgba(33, 88, 95, 0.26) 24%, rgba(3, 20, 38, 0.76) 70%);
  box-shadow:
    inset -9px -12px 22px rgba(0, 0, 0, 0.25),
    0 18px 40px rgba(0, 0, 0, 0.2);
}

.mg-orb-one {
  width: 66px;
  height: 66px;
  left: 20px;
  top: 48px;
}

.mg-orb-two {
  width: 58px;
  height: 58px;
  right: 15px;
  top: 115px;
}

.mg-orb-three {
  width: 46px;
  height: 46px;
  left: 45px;
  bottom: 38px;
}

.mg-orb-four {
  width: 72px;
  height: 72px;
  right: 28px;
  bottom: 10px;
}

.mg-visual-copy {
  position: absolute;
  z-index: 5;
  right: 55px;
  bottom: 18px;
  left: 55px;
}

.mg-copy-line {
  position: relative;
  height: 1px;
  margin-bottom: 11px;
  background: rgba(255, 255, 255, 0.16);
}

.mg-copy-line span {
  position: absolute;
  left: 50%;
  top: -1px;
  width: 80px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--mg-green-light), transparent);
  transform: translateX(-50%);
}

.mg-visual-copy blockquote {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  padding: 0 36px;
  text-align: center;
}

.mg-visual-copy blockquote > i {
  position: absolute;
  left: 0;
  top: 0;
  color: #50a4ff;
  font-size: 18px;
}

.mg-visual-copy .mg-quote-end {
  right: 0;
  bottom: 0;
  left: auto;
  top: auto;
  color: var(--mg-green-light);
  transform: rotate(180deg);
}

.mg-visual-copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
}

/* FORM PANEL */
.mg-form-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px clamp(38px, 4vw, 68px) 30px;
  background: #fff;
}

.mg-brand {
  position: absolute;
  right: 28px;
  top: 18px;
}

.mg-brand img {
  width: 74px;
  height: 38px;
  object-fit: contain;
}

.mg-form-wrap {
  width: 100%;
  max-width: 470px;
  margin: auto;
}

.mg-eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--mg-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mg-form-wrap h1 {
  margin: 0;
  color: #0c1728;
  font-size: clamp(27px, 2.5vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.mg-intro {
  margin: 8px 0 18px;
  color: var(--mg-muted);
  font-size: 13px;
  line-height: 1.5;
}

.mg-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid #fecdca;
  border-radius: 12px;
  color: var(--mg-danger);
  background: var(--mg-danger-soft);
  font-size: 10px;
  line-height: 1.45;
}

.mg-alert i {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 15px;
}

.mg-login-form {
  display: grid;
  gap: 13px;
}

.mg-field label {
  display: block;
  margin-bottom: 5px;
  color: #344054;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.mg-input-wrap {
  position: relative;
}

.mg-input-wrap > i {
  position: absolute;
  z-index: 2;
  left: 15px;
  top: 50%;
  color: #98a8ba;
  font-size: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}

.mg-input-wrap input {
  width: 100%;
  height: 50px;
  padding: 0 46px;
  border: 1px solid var(--mg-line);
  border-radius: 12px;
  outline: 0;
  color: var(--mg-text);
  background: #f9fbfd;
  font-size: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.mg-input-wrap input::placeholder {
  color: #a8b3c3;
}

.mg-input-wrap input:hover {
  border-color: #b8c7d7;
}

.mg-input-wrap input:focus {
  border-color: var(--mg-green);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(31, 138, 91, 0.11);
}

.mg-input-wrap:focus-within > i {
  color: var(--mg-green);
}

.mg-password-toggle {
  position: absolute;
  z-index: 3;
  right: 6px;
  top: 50%;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #8ea0b4;
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  transform: translateY(-50%);
}

.mg-password-toggle:hover,
.mg-password-toggle:focus-visible {
  color: var(--mg-green);
  background: var(--mg-green-pale);
  outline: 0;
}

.mg-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: -2px;
}

.mg-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #526176;
  font-size: 10px;
  cursor: pointer;
}

.mg-remember input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--mg-green);
}

.mg-help {
  color: var(--mg-green);
  font-size: 10px;
  font-weight: 600;
}

.mg-submit-btn {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 0;
  padding: 11px 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(100deg, #0b2138, #10394b);
  box-shadow: 0 12px 24px rgba(8, 35, 54, 0.2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.mg-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 19px 35px rgba(8, 35, 54, 0.26);
}

.mg-submit-btn:focus-visible {
  outline: 3px solid rgba(31, 138, 91, 0.25);
  outline-offset: 3px;
}

.mg-submit-btn:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.mg-submit-btn i {
  font-size: 16px;
}

.mg-assistance {
  margin: 12px 0 0;
  color: #98a2b3;
  font-size: 9px;
  text-align: center;
}

.mg-copyright {
  position: absolute;
  right: 30px;
  bottom: 10px;
  left: 30px;
  margin: 0;
  color: #b0bac7;
  font-size: 9px;
  text-align: center;
}

.mg-spin {
  animation: mg-spin 0.75s linear infinite;
}

@keyframes mg-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1050px) {
  .mg-login-page {
    padding: 16px;
  }

  .mg-login-shell {
    grid-template-columns: minmax(340px, 0.85fr) minmax(430px, 1.15fr);
    min-height: 0;
    border-radius: 26px;
  }

  .mg-visual-panel {
    padding-inline: 28px;
  }

  .mg-scene {
    transform: translate(-50%, -50%) scale(0.82);
  }

  .mg-visual-copy {
    right: 28px;
    left: 28px;
  }
}

@media (max-height: 680px) and (min-width: 821px) {
  .mg-login-page {
    padding: 10px;
  }

  .mg-login-shell {
    height: calc(100vh - 20px);
  }

  .mg-login-badge {
    padding: 6px 11px;
    font-size: 9px;
  }

  .mg-scene {
    top: 52%;
    transform: translate(-50%, -50%) scale(0.82);
  }

  .mg-visual-copy {
    display: none;
  }

  .mg-form-panel {
    padding: 34px clamp(34px, 4vw, 58px) 24px;
  }

  .mg-brand {
    top: 10px;
  }

  .mg-intro {
    margin: 6px 0 12px;
  }

  .mg-login-form {
    gap: 10px;
  }

  .mg-input-wrap input {
    height: 46px;
  }

  .mg-submit-btn {
    min-height: 46px;
  }

  .mg-assistance {
    margin-top: 8px;
  }

  .mg-copyright {
    bottom: 6px;
  }
}

@media (max-width: 820px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .mg-login-page {
    width: 100%;
    height: auto;
    min-height: 100vh;
    display: block;
    padding: 0;
  }

  .mg-login-shell {
    width: 100%;
    height: auto;
    min-height: 100vh;
    max-height: none;
    display: block;
    border: 0;
    border-radius: 0;
  }

  .mg-visual-panel {
    min-height: 240px;
    padding: 16px 24px;
  }

  .mg-login-badge {
    margin: 0;
    font-size: 10px;
  }

  .mg-mobile-copy-group {
    position: absolute;
    z-index: 6;
    left: 24px;
    top: 50%;
    width: 54%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    transform: translateY(-50%);
  }

  .mg-scene {
    left: 74%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.42);
  }

  .mg-visual-copy {
    position: static;
    width: 100%;
  }

  .mg-copy-line {
    display: none;
  }

  .mg-visual-copy blockquote {
    padding: 0;
    text-align: center;
  }

  .mg-visual-copy blockquote > i {
    display: none;
  }

  .mg-visual-copy p {
    max-width: 430px;
    margin: 0 auto;
    font-size: 12px;
    line-height: 1.35;
  }

  .mg-form-panel {
    min-height: calc(100vh - 240px);
    padding: 64px 28px 52px;
  }

  .mg-brand {
    right: 24px;
    top: 15px;
  }

  .mg-brand img {
    width: 72px;
  }
}

@media (max-width: 560px) {
  .mg-visual-panel {
    min-height: 155px;
    padding: 14px 20px;
  }

  .mg-login-badge {
    padding: 7px 12px;
    font-size: 9px;
  }

  .mg-mobile-copy-group {
    left: 16px;
    width: 55%;
    gap: 11px;
  }

  .mg-scene {
    left: 77%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.32);
  }

  .mg-visual-copy {
    width: 100%;
  }

  .mg-visual-copy p {
    font-size: 10px;
    line-height: 1.35;
  }

  .mg-form-panel {
    min-height: calc(100vh - 210px);
    padding: 58px 20px 46px;
  }

  .mg-eyebrow {
    font-size: 10px;
  }

  .mg-form-wrap h1 {
    font-size: 29px;
  }

  .mg-intro {
    margin-bottom: 24px;
    font-size: 13px;
  }

  .mg-input-wrap input,
  .mg-submit-btn {
    min-height: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .mg-form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .mg-copyright {
    font-size: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
