:root {
  --portal-primary: #f4b000;
  --portal-primary-dark: #d89400;
  --portal-ink: #18212f;
  --portal-muted: #6e7886;
  --portal-line: #e3e8ee;
  --portal-surface: #ffffff;
  --portal-page: #f4f6f9;
  --portal-danger: #bf3232;
  --portal-success: #137b50;
  --portal-radius: 22px;
  --portal-shadow: 0 24px 70px rgba(22, 35, 53, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--portal-page);
}

body.portal-login {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--portal-ink);
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--portal-page);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.portal-login__layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
}

/* Left welcome panel */
.portal-login__intro {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: clamp(44px, 7vw, 110px);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(13, 27, 47, 0.95), rgba(27, 55, 86, 0.92)),
    #193a5b;
}

.portal-login__intro-content {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
}

.portal-login__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.portal-login__eyebrow i {
  color: var(--portal-primary);
  font-size: 1rem;
}

.portal-login__intro h1 {
  max-width: 450px;
  margin: 24px 0 18px;
  font-size: clamp(2.5rem, 4.5vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.portal-login__intro p {
  max-width: 390px;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
}

.portal-login__features {
  display: grid;
  gap: 14px;
  margin-top: 42px;
}

.portal-login__features div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.portal-login__features i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  color: var(--portal-primary);
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.12rem;
}

.portal-login__orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.portal-login__orb--one {
  right: -160px;
  bottom: -160px;
  width: 470px;
  height: 470px;
  border: 70px solid rgba(244, 176, 0, 0.13);
}

.portal-login__orb--two {
  top: -110px;
  right: -80px;
  width: 250px;
  height: 250px;
  background: rgba(255, 255, 255, 0.055);
}

/* Right login area */
.portal-login__panel {
  display: grid;
  min-width: 0;
  place-items: center;
  padding: 44px 32px;
  background:
    radial-gradient(
      circle at 80% 10%,
      rgba(244, 176, 0, 0.13),
      transparent 28rem
    ),
    var(--portal-page);
}

.portal-login__card {
  width: min(100%, 470px);
  padding: clamp(28px, 4vw, 46px);
  border: 1px solid rgba(222, 228, 235, 0.85);
  border-radius: var(--portal-radius);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--portal-shadow);
}

.portal-login__brand {
  display: block;
  width: fit-content;
  max-width: 220px;
  margin-bottom: 42px;
}

.portal-login__brand img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  object-position: left center;
}

.portal-login__header h2 {
  margin: 0;
  color: var(--portal-ink);
  font-size: clamp(1.75rem, 3vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.portal-login__header p {
  margin: 9px 0 28px;
  color: var(--portal-muted);
  font-size: 1rem;
}

.portal-login__form {
  display: grid;
  gap: 20px;
}

.portal-field {
  min-width: 0;
}

.portal-field label {
  display: block;
  margin: 0 0 8px;
  color: #3b4553;
  font-size: 0.93rem;
  font-weight: 700;
}

.portal-field__label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.portal-login__forgot {
  padding: 0;
  border: 0;
  color: #4b5e73;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-field__control {
  display: flex;
  align-items: center;
  min-height: 57px;
  overflow: hidden;
  border: 1px solid var(--portal-line);
  border-radius: 13px;
  background: #fff;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.portal-field__control:focus-within {
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 4px rgba(244, 176, 0, 0.16);
}

.portal-field__control > i {
  flex: 0 0 48px;
  color: #788493;
  text-align: center;
  font-size: 1.1rem;
}

.portal-field__control input {
  width: 100%;
  min-width: 0;
  height: 55px;
  padding: 0 15px 0 0;
  border: 0;
  outline: 0;
  color: var(--portal-ink);
  background: transparent;
  font-size: 1rem;
}

.portal-field__control input::placeholder {
  color: #9aa4b0;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 13px;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.portal-button:hover {
  transform: translateY(-1px);
}

.portal-button:focus-visible,
.portal-login__forgot:focus-visible,
.portal-login__website:focus-visible,
.portal-modal__close:focus-visible {
  outline: 3px solid rgba(244, 176, 0, 0.5);
  outline-offset: 3px;
}

.portal-button--primary {
  color: #18212f;
  background: var(--portal-primary);
  box-shadow: 0 9px 18px rgba(216, 148, 0, 0.2);
}

.portal-button--primary:hover {
  color: #18212f;
  background: #ffc52a;
  box-shadow: 0 13px 23px rgba(216, 148, 0, 0.27);
}

.portal-button--secondary {
  color: #344150;
  border-color: var(--portal-line);
  background: #fff;
}

.portal-button--secondary:hover {
  color: #18212f;
  border-color: #bdc7d2;
  background: #f8fafc;
}

.portal-login__footer {
  margin-top: 31px;
  padding-top: 23px;
  border-top: 1px solid var(--portal-line);
  text-align: center;
}

.portal-login__website {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px;
  border: 0;
  color: #596675;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.portal-login__website:hover {
  color: var(--portal-ink);
}

/* Flash messages */
.portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 13px 15px;
  border-radius: 12px;
  font-weight: 600;
}

.portal-alert--success {
  color: var(--portal-success);
  background: #e9f8f0;
}

.portal-alert--error {
  color: var(--portal-danger);
  background: #fff0f0;
}

/* Bootstrap modal behaviour, fully custom visual styling */
.portal-modal .modal-content {
  position: relative;
  padding: clamp(26px, 5vw, 36px);
  border: 0;
  border-radius: 20px;
  color: var(--portal-ink);
  text-align: center;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 25, 38, 0.25);
}

.portal-modal__icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 17px;
  color: #513900;
  background: #fff1c8;
  font-size: 1.45rem;
}

.portal-modal h3 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
}

.portal-modal p {
  margin: 9px auto 25px;
  color: var(--portal-muted);
}

.portal-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #657180;
  background: #f1f4f7;
}

.portal-modal__close:hover {
  color: var(--portal-ink);
  background: #e4e9ef;
}

.portal-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.portal-modal__message {
  min-height: 0;
  color: var(--portal-danger);
  font-weight: 600;
}

/* Tablet */
@media (max-width: 991.98px) {
  .portal-login__layout {
    grid-template-columns: minmax(285px, 0.75fr) minmax(420px, 1.25fr);
  }

  .portal-login__intro {
    padding: 42px 34px;
  }

  .portal-login__intro h1 {
    font-size: 3rem;
  }

  .portal-login__features {
    margin-top: 30px;
  }

  .portal-login__panel {
    padding: 34px 26px;
  }
}

/* Phone */
@media (max-width: 767.98px) {
  .portal-login__layout {
    display: block;
  }

  .portal-login__intro {
    min-height: 210px;
    padding: 32px 25px;
  }

  .portal-login__intro h1 {
    margin: 14px 0 9px;
    font-size: 2.25rem;
  }

  .portal-login__intro p {
    max-width: 330px;
    font-size: 1rem;
  }

  .portal-login__features {
    display: none;
  }

  .portal-login__orb--one {
    right: -120px;
    bottom: -155px;
    width: 330px;
    height: 330px;
    border-width: 50px;
  }

  .portal-login__orb--two {
    top: -90px;
    right: -80px;
    width: 190px;
    height: 190px;
  }

  .portal-login__panel {
    display: block;
    padding: 0 15px 24px;
    background: var(--portal-page);
  }

  .portal-login__card {
    margin-top: -28px;
    padding: 28px 22px;
    border-radius: 19px;
  }

  .portal-login__brand {
    max-width: 175px;
    margin-bottom: 30px;
  }

  .portal-login__header p {
    margin-bottom: 24px;
  }

  .portal-modal .modal-dialog {
    margin: 14px;
  }

  .portal-modal__actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 374.98px) {
  .portal-login__card {
    padding: 25px 17px;
  }

  .portal-field__label-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

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

@media (max-width: 767.98px) {
  .portal-login__brand {
    display: block;
    margin-top: 10px;
  }
}
