:root {
  color-scheme: light;
  --ink: #211b17;
  --ink-soft: #685d54;
  --espresso: #17120d;
  --espresso-2: #2a211a;
  --cream: #f8f4ec;
  --paper: #fffdf9;
  --gold: #aa761e;
  --gold-dark: #865b14;
  --gold-soft: #ead5a6;
  --line: #ded6ca;
  --field: #fbf9f5;
  --danger: #ad2d25;
  --success: #17683b;
  --shadow: 0 32px 90px rgba(37, 25, 16, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--cream);
  font-family: "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  padding: clamp(22px, 4vw, 54px);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(196, 144, 49, 0.14), transparent 31rem),
    radial-gradient(circle at 92% 88%, rgba(71, 52, 38, 0.1), transparent 32rem),
    linear-gradient(135deg, #f4eee3 0%, #fbf9f4 48%, #efe6d8 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(170, 118, 30, 0.13);
  border-radius: 50%;
  pointer-events: none;
}

body::before {
  top: -168px;
  left: -110px;
  box-shadow: 0 0 0 32px rgba(170, 118, 30, 0.025), 0 0 0 70px rgba(170, 118, 30, 0.018);
}

body::after {
  right: -150px;
  bottom: -170px;
  box-shadow: 0 0 0 44px rgba(37, 26, 18, 0.025), 0 0 0 88px rgba(37, 26, 18, 0.018);
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(170, 118, 30, 0.38);
  outline-offset: 3px;
}

.back-home {
  position: fixed;
  z-index: 20;
  top: 22px;
  right: 26px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid rgba(53, 40, 29, 0.12);
  border-radius: 999px;
  color: #493b31;
  background: rgba(255, 253, 249, 0.76);
  box-shadow: 0 8px 26px rgba(44, 31, 21, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.back-home:hover {
  border-color: rgba(134, 91, 20, 0.4);
  color: var(--gold-dark);
  transform: translateY(-1px);
}

.back-home > span:first-child {
  font-size: 1.05rem;
  line-height: 1;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(1160px, 100%);
  min-height: min(690px, calc(100svh - 88px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
  overflow: hidden;
  border: 1px solid rgba(63, 45, 31, 0.13);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.brand-panel {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  isolation: isolate;
  color: #fffaf0;
  background-color: #1c160f;
  background-image: url("/assets/photos/jamallta-business-photo.jpg");
  background-position: center 36%;
  background-size: cover;
}

.brand-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 12, 8, 0.6) 0%, rgba(18, 13, 9, 0.24) 34%, rgba(19, 13, 8, 0.9) 100%),
    linear-gradient(110deg, rgba(52, 32, 15, 0.35), transparent 70%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -95px;
  bottom: -105px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(231, 199, 129, 0.26);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(231, 199, 129, 0.035), 0 0 0 76px rgba(231, 199, 129, 0.02);
}

.brand-content {
  height: 100%;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 64px);
}

.brand-lockup {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  color: inherit;
  text-decoration: none;
}

.brand-lockup img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid rgba(255, 245, 221, 0.42);
  border-radius: 18px;
  box-shadow: 0 13px 34px rgba(0, 0, 0, 0.25);
}

.brand-name {
  display: grid;
  gap: 3px;
}

.brand-name strong,
.mobile-brand strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.brand-name small {
  color: rgba(255, 248, 232, 0.72);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.brand-message {
  width: min(465px, 100%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold-dark);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand-message > .eyebrow {
  color: #e8c982;
}

.brand-message h1 {
  max-width: 450px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.55rem, 4.5vw, 4.35rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.99;
  text-wrap: balance;
}

.brand-message > p:not(.eyebrow) {
  max-width: 410px;
  margin: 22px 0 0;
  color: rgba(255, 250, 241, 0.78);
  font-size: 0.97rem;
  line-height: 1.7;
}

.portal-assurance {
  width: fit-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding: 13px 16px 13px 13px;
  border: 1px solid rgba(255, 243, 214, 0.19);
  border-radius: 16px;
  background: rgba(21, 14, 9, 0.33);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.assurance-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 201, 130, 0.48);
  border-radius: 50%;
  color: #f0d59d;
  background: rgba(230, 191, 105, 0.12);
  font-size: 0.9rem;
  font-weight: 900;
}

.portal-assurance > span:last-child {
  display: grid;
  gap: 2px;
}

.portal-assurance strong {
  font-size: 0.78rem;
  letter-spacing: 0.015em;
}

.portal-assurance small {
  color: rgba(255, 248, 234, 0.65);
  font-size: 0.68rem;
  line-height: 1.45;
}

.auth-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 5vw, 72px);
  background:
    radial-gradient(circle at 100% 0%, rgba(201, 157, 72, 0.09), transparent 19rem),
    var(--paper);
}

.mobile-brand {
  display: none;
}

.login-box {
  width: min(100%, 430px);
  margin: auto;
}

.auth-heading {
  margin-bottom: 31px;
}

.auth-heading h2,
.modal-box h3 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.026em;
}

.auth-heading h2 {
  font-size: clamp(1.95rem, 3vw, 2.48rem);
  line-height: 1.12;
}

.auth-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.89rem;
  line-height: 1.65;
}

.input-group {
  margin-bottom: 18px;
}

.input-group label,
.field-label {
  display: block;
  margin: 0 0 8px;
  color: #3a3029;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.012em;
}

.input-group input,
.modal-box input {
  width: 100%;
  min-height: 54px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: var(--field);
  font-size: 0.9rem;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.input-group input::placeholder,
.modal-box input::placeholder {
  color: #948a80;
  opacity: 1;
}

.input-group input:hover,
.modal-box input:hover {
  border-color: #c7b8a4;
}

.input-group input:focus,
.modal-box input:focus {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(170, 118, 30, 0.11);
}

.password-control {
  position: relative;
}

.password-control input {
  padding-right: 74px;
}

.toggle-pass {
  position: absolute;
  top: 50%;
  right: 9px;
  min-width: 53px;
  min-height: 36px;
  padding: 6px 8px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 9px;
  color: var(--gold-dark);
  background: transparent;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.toggle-pass:hover {
  background: rgba(170, 118, 30, 0.08);
}

#loginBtn {
  width: 100%;
  min-height: 55px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  padding: 13px 18px;
  border: 1px solid var(--espresso);
  border-radius: 13px;
  color: #fffaf2;
  background: var(--espresso);
  box-shadow: 0 13px 28px rgba(37, 27, 20, 0.17);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

#loginBtn:hover:not(:disabled) {
  border-color: #3d2d21;
  background: #33271f;
  box-shadow: 0 16px 32px rgba(37, 27, 20, 0.22);
  transform: translateY(-1px);
}

#loginBtn:active:not(:disabled) {
  transform: translateY(0);
}

#loginBtn:disabled,
.modal-actions button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.btn-loader {
  display: none;
  width: 19px;
  height: 19px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

#loginBtn.loading .btn-text {
  display: none;
}

#loginBtn.loading .btn-loader {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.links {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 17px;
}

.links button {
  min-height: 38px;
  margin: -6px;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  color: var(--gold-dark);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
}

.links button:hover {
  color: #61400d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.error {
  display: none;
  margin: 17px 0 0;
  padding: 11px 12px;
  border: 1px solid rgba(173, 45, 37, 0.2);
  border-radius: 10px;
  color: var(--danger);
  background: rgba(173, 45, 37, 0.055);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}

.error:not(:empty) {
  display: block;
}

.security-reminder {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 24px;
  padding-top: 21px;
  border-top: 1px solid #ebe5dc;
}

.security-icon,
.modal-mark {
  position: relative;
  flex: 0 0 auto;
  border: 1px solid rgba(134, 91, 20, 0.25);
  background: #f6eddb;
}

.security-icon {
  width: 27px;
  height: 27px;
  border-radius: 50%;
}

.security-icon::before,
.modal-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 8px;
  height: 7px;
  transform: translateX(-50%);
  border: 2px solid var(--gold-dark);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.security-icon::before {
  top: 5px;
}

.security-icon::after,
.modal-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 12px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: var(--gold-dark);
}

.security-icon::after {
  top: 12px;
}

.security-reminder p {
  margin: 0;
  color: #75695f;
  font-size: 0.7rem;
  line-height: 1.55;
}

.security-reminder strong {
  color: #4b3e35;
}

.auth-footer {
  width: min(100%, 430px);
  margin: 29px auto 0;
  color: #958a80;
  font-size: 0.65rem;
  letter-spacing: 0.025em;
  text-align: center;
}

.auth-footer span {
  margin: 0 5px;
}

.page-loader,
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(17, 12, 8, 0.68);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.loader-box {
  width: min(330px, 100%);
  padding: 34px 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.spinner {
  width: 37px;
  height: 37px;
  margin: 0 auto 17px;
  border: 3px solid #e5dccd;
  border-top-color: var(--gold-dark);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

.loader-box p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-weight: 600;
}

.loader-box small {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.modal {
  z-index: 1100;
  overflow-y: auto;
}

.modal-box {
  width: min(440px, 100%);
  max-height: calc(100svh - 44px);
  overflow-y: auto;
  padding: clamp(26px, 5vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.modal-mark {
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border-radius: 13px;
}

.modal-mark::before {
  top: 8px;
  width: 11px;
  height: 9px;
}

.modal-mark::after {
  top: 18px;
  width: 17px;
  height: 13px;
  border-radius: 3px;
}

.modal-box h3 {
  font-size: 1.75rem;
  line-height: 1.2;
}

.modal-box > p:not(.eyebrow):not(.modal-message) {
  margin: 10px 0 22px;
  color: var(--ink-soft);
  font-size: 0.81rem;
  line-height: 1.6;
}

.modal-box input {
  margin: 0 0 17px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 7px;
}

.modal-actions button {
  min-height: 48px;
  flex: 1 1 0;
  padding: 11px 14px;
  border: 1px solid var(--espresso);
  border-radius: 11px;
  color: #fff;
  background: var(--espresso);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.modal-actions button:hover:not(:disabled) {
  background: #33271f;
  transform: translateY(-1px);
}

.modal-actions .cancel {
  border-color: #dfd7cb;
  color: #54483e;
  background: #f4f0e9;
}

.modal-actions .cancel:hover:not(:disabled) {
  border-color: #cfc4b6;
  background: #ebe4da;
}

#newPassModal .modal-box {
  width: min(460px, 100%);
}

#newPassForm .field-label:not(:first-child) {
  margin-top: 2px;
}

.hidden {
  display: none !important;
}

.otp-row {
  margin-top: 20px;
}

.recaptcha-slot {
  min-height: 0;
  margin-top: 10px;
}

.modal-message {
  min-height: 0;
  margin: 17px 0 0;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.5;
}

.modal-message:empty {
  display: none;
}

@media (max-width: 920px) {
  body {
    padding: 74px 22px 28px;
  }

  .back-home {
    top: 16px;
    right: 18px;
  }

  .login-shell {
    width: min(540px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
    border-radius: 27px;
  }

  .brand-panel {
    display: none;
  }

  .auth-panel {
    min-height: 650px;
    padding: 40px clamp(24px, 8vw, 52px) 28px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 430px);
    margin: 0 auto 42px;
  }

  .mobile-brand img {
    width: 56px;
    height: 56px;
    border: 1px solid #e1d4c0;
    border-radius: 15px;
    object-fit: cover;
    box-shadow: 0 9px 24px rgba(50, 34, 22, 0.1);
  }

  .mobile-brand > span {
    display: grid;
    gap: 3px;
  }

  .mobile-brand strong {
    color: #35291f;
    font-size: 1.08rem;
  }

  .mobile-brand small {
    color: #8c7b6e;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.105em;
    text-transform: uppercase;
  }

  .auth-footer {
    margin-top: 34px;
  }
}

@media (max-width: 560px) {
  body {
    place-items: start center;
    padding: 68px 0 0;
    background: var(--paper);
  }

  body::before,
  body::after {
    display: none;
  }

  .back-home {
    top: 12px;
    right: 12px;
    min-height: 38px;
    padding: 8px 12px;
    background: rgba(255, 253, 249, 0.92);
    font-size: 0.75rem;
  }

  .login-shell {
    width: 100%;
    min-height: calc(100svh - 68px);
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-panel {
    min-height: calc(100svh - 68px);
    justify-content: flex-start;
    padding: 27px 22px 24px;
  }

  .mobile-brand {
    margin-bottom: 38px;
  }

  .auth-heading {
    margin-bottom: 27px;
  }

  .auth-heading h2 {
    font-size: 1.92rem;
  }

  .auth-heading > p:last-child {
    font-size: 0.82rem;
  }

  .input-group {
    margin-bottom: 16px;
  }

  .input-group input {
    min-height: 53px;
    font-size: 16px;
  }

  #loginBtn {
    min-height: 54px;
  }

  .security-reminder {
    margin-top: 22px;
  }

  .modal,
  .page-loader {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-box,
  #newPassModal .modal-box {
    width: 100%;
    max-height: calc(100svh - 24px);
    padding: 27px 22px max(24px, env(safe-area-inset-bottom));
    border-radius: 22px;
  }

  .loader-box {
    margin: auto;
  }
}

@media (max-width: 370px) {
  .auth-panel {
    padding-right: 18px;
    padding-left: 18px;
  }

  .links {
    gap: 8px;
  }

  .links button {
    font-size: 0.7rem;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (min-width: 921px) and (max-height: 760px) {
  body {
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .login-shell {
    min-height: 630px;
  }

  .brand-content,
  .auth-panel {
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .brand-message h1 {
    font-size: clamp(2.7rem, 4vw, 3.7rem);
  }
}

@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;
  }
}

@media (forced-colors: active) {
  .brand-panel::before {
    background: rgba(0, 0, 0, 0.72);
  }

  .security-icon::after,
  .modal-mark::after {
    background: CanvasText;
  }
}
