:root {
  --portal-primary: #ad8436;
  --portal-primary-dark: #8d6826;
  --portal-primary-light: #d4b778;
  --portal-ink: #111111;
  --portal-muted: #746d63;
  --portal-line: #e7e0d5;
  --portal-surface: #ffffff;
  --portal-page: #f7f4ee;
  --portal-cream: #efe6d6;
  --portal-black: #090909;
  --portal-danger: #b83d3d;
  --portal-success: #2d7757;
  --portal-radius: 22px;
  --portal-shadow: 0 24px 70px rgba(24, 18, 8, 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:
    radial-gradient(circle at 15% 8%, rgba(173, 132, 54, 0.11), transparent 25rem),
    radial-gradient(circle at 90% 90%, rgba(212, 183, 120, 0.12), transparent 28rem),
    linear-gradient(145deg, #fbfaf7 0%, #f4efe6 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.portal-login__page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 38px 20px;
  overflow: hidden;
}

.portal-login__page::before,
.portal-login__page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.portal-login__page::before {
  width: 430px;
  height: 430px;
  top: -270px;
  right: -130px;
  border: 1px solid rgba(173, 132, 54, 0.13);
  box-shadow:
    0 0 0 55px rgba(173, 132, 54, 0.025),
    0 0 0 110px rgba(173, 132, 54, 0.018);
}

.portal-login__page::after {
  width: 280px;
  height: 280px;
  left: -180px;
  bottom: -160px;
  background: rgba(173, 132, 54, 0.045);
}

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

.portal-login__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 0 6px;
}

.portal-login__brand {
  display: block;
  width: min(210px, 48vw);
}

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

.portal-login__portal-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 7px 11px;
  border: 1px solid #dfd2ba;
  border-radius: 999px;
  color: var(--portal-primary-dark);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.portal-login__portal-label i {
  color: var(--portal-primary);
  font-size: 0.9rem;
}

.portal-login__card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid rgba(218, 207, 189, 0.85);
  border-radius: var(--portal-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--portal-shadow);
  backdrop-filter: blur(12px);
}

.portal-login__card-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--portal-black), var(--portal-primary), var(--portal-primary-light));
}

.portal-login__header {
  margin-bottom: 28px;
}

.portal-login__eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--portal-primary-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.portal-login__header h1 {
  margin: 0;
  color: var(--portal-black);
  font-size: clamp(2rem, 6vw, 2.7rem);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -0.04em;
}

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

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

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

.portal-field label {
  display: block;
  margin: 0 0 8px;
  color: #3d3933;
  font-size: 0.91rem;
  font-weight: 750;
}

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

.portal-login__forgot {
  padding: 0;
  border: 0;
  color: var(--portal-primary-dark);
  background: transparent;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: rgba(173, 132, 54, 0.38);
  text-underline-offset: 3px;
}

.portal-login__forgot:hover {
  color: var(--portal-black);
}

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

.portal-field__control:hover {
  border-color: #d8cbb5;
}

.portal-field__control:focus-within {
  border-color: var(--portal-primary);
  box-shadow: 0 0 0 4px rgba(173, 132, 54, 0.13);
  background: #fffdfa;
}

.portal-field__control > i {
  flex: 0 0 49px;
  color: #9a8a73;
  text-align: center;
  font-size: 1.05rem;
}

.portal-field__control:focus-within > i {
  color: var(--portal-primary);
}

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

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

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

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

.portal-button--primary {
  color: #fff;
  background: linear-gradient(135deg, #b68c3d, #9a722c);
  box-shadow: 0 10px 20px rgba(141, 104, 38, 0.19);
}

.portal-button--primary:hover {
  color: #fff;
  background: var(--portal-black);
  box-shadow: 0 13px 24px rgba(9, 9, 9, 0.17);
}

.portal-button--secondary {
  color: #3e3932;
  border-color: #ded4c4;
  background: #fff;
}

.portal-button--secondary:hover {
  color: var(--portal-primary-dark);
  border-color: #ccb78e;
  background: #faf7f1;
}

.portal-button:focus-visible,
.portal-login__forgot:focus-visible,
.portal-login__website:focus-visible,
.portal-modal__close:focus-visible {
  outline: 3px solid rgba(173, 132, 54, 0.42);
  outline-offset: 3px;
}

.portal-login__divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  margin: -2px 0;
  color: #9b9184;
  font-size: 0.77rem;
  font-weight: 650;
}

.portal-login__divider::before,
.portal-login__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #eee8df;
}

.portal-login__divider span {
  padding: 0 12px;
}

.portal-login__trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 27px;
  padding-top: 22px;
  border-top: 1px solid #eee9e1;
}

.portal-login__trust div {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: #786f63;
  font-size: 0.71rem;
  font-weight: 700;
  text-align: center;
}

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

.portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 650;
}

.portal-alert--success {
  color: #27664b;
  border-color: #cde6d8;
  background: #edf7f1;
}

.portal-alert--error {
  color: #9d3535;
  border-color: #efd1d1;
  background: #fff3f2;
}

.portal-login__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
  color: #81786d;
  font-size: 0.82rem;
}

.portal-login__website {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px;
  border: 0;
  color: var(--portal-primary-dark);
  background: transparent;
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.portal-login__footer-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #cbbda6;
}

/* Login-page modal refinements */
.portal-login .portal-modal .modal-content {
  color: var(--portal-ink);
}

.portal-login .portal-modal__icon {
  color: var(--portal-primary-dark);
  background: #f5ead7;
}

@media (max-width: 575.98px) {
  .portal-login__page {
    align-items: start;
    padding: 22px 14px 28px;
  }

  .portal-login__top {
    justify-content: center;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .portal-login__brand {
    width: min(190px, 60vw);
  }

  .portal-login__portal-label {
    font-size: 0.65rem;
  }

  .portal-login__card {
    padding: 29px 20px 24px;
    border-radius: 18px;
  }

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

  .portal-login__header h1 {
    font-size: 2rem;
  }

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

  .portal-login__trust {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .portal-login__trust div {
    justify-content: flex-start;
  }

  .portal-login__footer {
    flex-direction: column;
    gap: 4px;
  }

  .portal-login__footer-dot {
    display: none;
  }
}

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