:root {
  color-scheme: light;
  --ink: #14231e;
  --ink-soft: #253a31;
  --paper: #f6f7f3;
  --white: #fff;
  --muted: #6c7870;
  --line: #dce2dc;
  --coral: #f1724d;
  --lime: #d8f36a;
  --focus: #18785f;
}

* {
  box-sizing: border-box;
}
html,
body {
  min-height: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.55 "DM Sans",
    sans-serif;
}
a {
  color: inherit;
  text-decoration: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(460px, 0.96fr);
  min-height: 100svh;
}
.brand-panel {
  position: relative;
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 34px clamp(34px, 6vw, 88px) 26px;
  background: var(--ink);
  color: #f5f7f1;
}
.brand-panel::after {
  position: absolute;
  right: -1px;
  bottom: 18%;
  width: 31%;
  height: 1px;
  background: var(--coral);
  content: "";
  opacity: 0.9;
}
.brand-header,
.brand-footer,
.form-topline,
.form-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand-mark {
  font:
    800 24px/1 "Manrope",
    sans-serif;
  letter-spacing: 0;
}
.brand-mark span {
  color: var(--coral);
}
.brand-caption,
.brand-footer,
.secure-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.brand-caption {
  color: #b6c3ba;
}
.brand-content {
  position: relative;
  z-index: 1;
  width: min(100%, 610px);
  margin: 72px auto;
  animation: content-in 650ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--coral);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(216, 243, 106, 0.12);
}
h1,
h2,
strong {
  font-family: "Manrope", sans-serif;
}
h1 {
  max-width: 660px;
  margin: 25px 0 18px;
  font-size: clamp(44px, 5.3vw, 76px);
  font-weight: 700;
  line-height: 1.04;
}
h1 span {
  color: var(--lime);
}
.brand-description {
  max-width: 440px;
  margin: 0;
  color: #c1cbc4;
  font-size: 16px;
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 34px;
}
.profile-photo {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 2px solid rgba(216, 243, 106, 0.72);
  border-radius: 50%;
  object-fit: cover;
}
.profile-row strong,
.profile-row span {
  display: block;
}
.profile-row strong {
  font-size: 13px;
}
.profile-row span {
  margin-top: 3px;
  color: #b6c3ba;
  font-size: 12px;
}
.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 50px;
  border-top: 1px solid #3a4c42;
  border-bottom: 1px solid #3a4c42;
}
.principles div {
  display: grid;
  gap: 7px;
  min-height: 77px;
  align-content: center;
  padding: 12px 10px;
  border-right: 1px solid #3a4c42;
}
.principles div:first-child {
  padding-left: 0;
}
.principles div:last-child {
  border: 0;
}
.principles span {
  color: var(--coral);
  font:
    700 10px "Manrope",
    sans-serif;
}
.principles strong {
  font-size: 11px;
  font-weight: 600;
}
.brand-footer {
  color: #aab8af;
  font-size: 9px;
}
.form-panel {
  display: flex;
  min-height: 100svh;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px clamp(30px, 5.4vw, 80px) 25px;
  background: var(--paper);
}
.form-topline {
  color: var(--muted);
}
.secure-label {
  color: var(--ink-soft);
  font-size: 9px;
}
.secure-label span {
  margin-right: 5px;
  color: #168463;
  font-size: 9px;
}
.back-link,
.subtle-link,
.form-footer a {
  color: var(--muted);
  font-size: 12px;
  transition: color 160ms ease;
}
.back-link:hover,
.subtle-link:hover,
.form-footer a:hover {
  color: var(--focus);
}
.form-wrap {
  width: min(100%, 410px);
  margin: 65px auto;
  animation: content-in 700ms 80ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.form-eyebrow {
  color: #168463;
}
h2 {
  margin: 12px 0 8px;
  font-size: clamp(29px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.16;
}
.form-description {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}
.auth-nav-tabs {
  display: flex;
  background: #e9eee8;
  padding: 4px;
  border-radius: 6px;
  gap: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}
.auth-tab-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font: 700 12px "Manrope", sans-serif;
  border-radius: 4px;
  cursor: pointer;
  transition: all 180ms ease;
  text-align: center;
}
.auth-tab-btn:hover {
  color: var(--ink);
}
.auth-tab-btn.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
#login-form {
  display: grid;
  gap: 19px;
}
.field {
  display: grid;
  gap: 8px;
}
.field label,
.label-row label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.subtle-link {
  font-size: 11px;
}
.field input:not([type="checkbox"]) {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid #d3dbd4;
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}
.field input::placeholder {
  color: #929d95;
}
.field input:focus {
  border-color: #188266;
  box-shadow: 0 0 0 3px rgba(24, 130, 102, 0.1);
  outline: 0;
}
.field input.input-error {
  border-color: #d93829 !important;
  background-color: #fff6f5 !important;
  box-shadow: 0 0 0 3px rgba(217, 56, 41, 0.2) !important;
  animation: shake 320ms ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 64px !important;
}
.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #28745f;
  font:
    700 11px "DM Sans",
    sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
}
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
}
.remember-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #536158;
  font-size: 12px;
  cursor: pointer;
}
.remember-option input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #18785f;
}
.submit-button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 2px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: var(--ink);
  color: #fff;
  font:
    700 13px "Manrope",
    sans-serif;
  cursor: pointer;
  transition:
    background 180ms ease,
    transform 180ms ease;
}
.submit-button:hover {
  background: #244338;
  transform: translateY(-1px);
}
.submit-button span {
  color: var(--lime);
  font-size: 17px;
}
.form-feedback {
  min-height: 18px;
  margin: -8px 0 0;
  color: #9c3b2b;
  font-size: 12px;
}
.form-feedback[data-type="success"] {
  color: #18785f;
}
.form-feedback[data-type="setup"],
.form-feedback[data-type="loading"] {
  color: #6c7870;
}
.field[hidden],
.remember-option[hidden],
.subtle-link[hidden],
.form-options[hidden],
.mode-switch[hidden],
.code-tip[hidden] {
  display: none !important;
}
.code-tip {
  margin: 6px 0 0;
  padding: 10px 12px;
  background: #edf5f0;
  border-left: 3px solid #18785f;
  border-radius: 3px;
  color: #27483c;
  font-size: 11px;
  line-height: 1.5;
}
.code-tip strong {
  color: #14231e;
}
.code-field {
  gap: 7px;
}
.code-destination {
  margin: -3px 0 3px;
  color: var(--muted);
  font-size: 12px;
}
#email-code {
  max-width: 100%;
  height: 58px !important;
  font:
    700 24px "Manrope",
    sans-serif !important;
  letter-spacing: 0.32em;
  text-align: center;
}
.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #18785f;
  font:
    700 11px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.text-button:hover {
  text-decoration: underline;
}
.code-options {
  align-items: center;
  min-height: 24px;
}
.resend-countdown {
  color: var(--muted);
  font-size: 11px;
}
.text-button:disabled {
  color: #89958d;
  cursor: wait;
  text-decoration: none;
}
.mode-switch {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.mode-switch button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #18785f;
  font:
    700 12px "DM Sans",
    sans-serif;
  cursor: pointer;
}
.mode-switch button:hover {
  text-decoration: underline;
}
.submit-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}
.access-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 26px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}
.note-mark {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #9eb0a4;
  border-radius: 50%;
  color: #52645a;
  font:
    700 11px "Manrope",
    sans-serif;
}
.access-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}
.form-footer {
  color: #7c8980;
  font-size: 10px;
}
@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.95fr);
  }
  .brand-panel {
    padding-inline: 34px;
  }
  .form-panel {
    padding-inline: 34px;
  }
}
@media (max-width: 700px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    min-height: auto;
    padding: 23px 22px 20px;
  }
  .brand-content {
    margin: 54px auto 38px;
  }
  h1 {
    max-width: 560px;
    margin: 18px 0 13px;
    font-size: clamp(42px, 10vw, 60px);
  }
  .brand-description {
    max-width: 520px;
    font-size: 14px;
  }
  .profile-row {
    margin-top: 25px;
  }
  .principles {
    margin-top: 28px;
  }
  .principles div {
    min-height: 64px;
    padding-inline: 7px;
  }
  .principles strong {
    font-size: 10px;
  }
  .brand-footer {
    font-size: 8px;
  }
  .form-panel {
    min-height: 620px;
    padding: 22px;
  }
  .form-wrap {
    margin: 58px auto;
  }
}
@media (max-width: 390px) {
  .brand-caption {
    max-width: 160px;
    text-align: right;
  }
  .principles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .principles div:nth-child(2) {
    border-right: 0;
  }
  .principles div:nth-child(-n + 2) {
    border-bottom: 1px solid #3a4c42;
  }
  .principles div:nth-child(3) {
    padding-left: 0;
  }
  .form-topline {
    align-items: flex-start;
  }
  .secure-label {
    max-width: 120px;
    line-height: 1.5;
  }
}

/* ==========================================================================
   Account Exists Modal Popup (High Aesthetic & Modern Alert)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 20, 16, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(168deg, #182a24 0%, #101d18 100%);
  border: 1px solid rgba(216, 243, 106, 0.22);
  border-radius: 22px;
  padding: 32px 28px 26px;
  text-align: center;
  box-shadow:
    0 24px 60px -12px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 45px -8px rgba(241, 114, 77, 0.28);
  transform: scale(0.92) translateY(18px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.is-open .modal-card {
  transform: scale(1) translateY(0);
}

/* Glowing top accent strip */
.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #f1724d 0%, #f59e0b 50%, #d8f36a 100%);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #a4b4ab;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: rotate(90deg);
}

.modal-badge-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(241, 114, 77, 0.65);
  animation: modal-radar-pulse 2.2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes modal-radar-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.95;
  }
  65% {
    transform: scale(1.48);
    opacity: 0;
  }
  100% {
    transform: scale(1.52);
    opacity: 0;
  }
}

.modal-badge-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(241, 114, 77, 0.24) 0%, rgba(245, 158, 11, 0.18) 100%);
  border: 1.5px solid rgba(241, 114, 77, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ff855f;
  box-shadow: 0 0 22px rgba(241, 114, 77, 0.35);
  animation: badge-float 3s ease-in-out infinite alternate;
}

@keyframes badge-float {
  0% { transform: translateY(0); }
  100% { transform: translateY(-3px); }
}

.modal-header-text {
  margin-bottom: 8px;
}

.modal-tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ff9170;
  background: rgba(241, 114, 77, 0.14);
  border: 1px solid rgba(241, 114, 77, 0.32);
  margin-bottom: 8px;
}

.modal-card h3 {
  margin: 0;
  color: #ffffff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin: 0 0 12px;
  color: #a2b4aa;
  font-size: 13.5px;
  line-height: 1.5;
}

.modal-email-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  max-width: 100%;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(216, 243, 106, 0.35);
  color: var(--lime);
  font-weight: 600;
  font-size: 13.5px;
  word-break: break-all;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.modal-email-chip svg {
  flex-shrink: 0;
  color: var(--lime);
}

.modal-sub {
  margin: 0 0 20px;
  color: #7b9185;
  font-size: 12px;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.modal-btn-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12.5px 20px;
  border-radius: 12px;
  border: none;
  background: var(--lime);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(216, 243, 106, 0.28);
}

.modal-btn-primary:hover {
  background: #e2f782;
  transform: translateY(-1.5px);
  box-shadow: 0 6px 22px rgba(216, 243, 106, 0.4);
}

.modal-btn-primary:active {
  transform: translateY(0);
}

.modal-btn-secondary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #c4d4cc;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

@media (max-width: 480px) {
  .modal-card {
    padding: 28px 18px 22px;
    border-radius: 18px;
  }
  .modal-card h3 {
    font-size: 19px;
  }
  .modal-desc {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
