:root {
  --pathline-navy: #19273b;
  --pathline-gold: #bc9d77;
  --pathline-cream: #f6f1e8;
  --pathline-ink: #233247;
  --pathline-muted: #687381;
  --pathline-line: #ded6ca;
  --pathline-error: #a42d2d;
  --pathline-success: #28613f;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--pathline-cream);
  color: var(--pathline-ink);
  font-family: "Be Vietnam Pro", Inter, Arial, sans-serif;
  line-height: 1.6;
}

button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(440px, 1.1fr);
}

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  min-height: 100vh;
  padding: 42px clamp(28px, 5vw, 78px);
  background: var(--pathline-navy);
  color: #fff;
}

.auth-brand::after {
  content: "";
  position: absolute;
  inset: auto -20% -28% 10%;
  height: 58%;
  border: 1px solid rgba(188, 157, 119, 0.3);
  border-radius: 50% 50% 0 0;
  transform: rotate(-10deg);
}

.auth-logo { position: relative; z-index: 1; display: inline-block; width: 132px; }
.auth-logo img { display: block; width: 100%; }

.auth-brand-copy { position: relative; z-index: 1; max-width: 540px; margin: 80px 0; }
.auth-kicker { margin: 0 0 16px; color: var(--pathline-gold); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.auth-brand h1, .auth-card h1, .portal-card h1 {
  margin: 0;
  color: inherit;
  font-family: Oswald, "Be Vietnam Pro", sans-serif;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.02;
  text-transform: uppercase;
}
.auth-brand-copy p:last-child { max-width: 470px; color: #ced5de; }
.auth-brand-footer { position: relative; z-index: 1; margin: 0; color: #9eacbd; font-size: 0.72rem; letter-spacing: 0.04em; }

.auth-main { display: grid; place-items: center; padding: 48px clamp(22px, 7vw, 96px); }
.auth-card { width: min(100%, 520px); }
.auth-card h1 { color: var(--pathline-navy); font-size: clamp(2.4rem, 5vw, 3.8rem); }
.auth-intro { margin: 14px 0 30px; color: var(--pathline-muted); }

.auth-form { display: grid; gap: 20px; }
.auth-field { display: grid; gap: 7px; }
.auth-field label { color: var(--pathline-navy); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.03em; }
.auth-field input {
  width: 100%;
  min-height: 52px;
  border: 1px solid #c9c0b4;
  border-radius: 0;
  background: #fff;
  color: var(--pathline-ink);
  padding: 12px 14px;
}
.auth-field input:focus { outline: 3px solid rgba(188, 157, 119, 0.23); border-color: var(--pathline-gold); }
.auth-field-note { margin: -12px 0 0; color: var(--pathline-muted); font-size: 0.76rem; }

.auth-button {
  min-height: 52px;
  border: 1px solid var(--pathline-gold);
  background: var(--pathline-gold);
  color: #fff;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.auth-button.secondary { background: transparent; color: var(--pathline-navy); }
.auth-button:disabled { cursor: wait; opacity: 0.65; }
.auth-button[data-busy="true"]::after { content: " ···"; }
.auth-links { display: flex; justify-content: space-between; gap: 16px; margin-top: 24px; font-size: 0.82rem; }
.auth-links a { color: var(--pathline-navy); font-weight: 700; text-underline-offset: 4px; }
.auth-status { min-height: 26px; margin: 18px 0 0; color: var(--pathline-muted); font-size: 0.84rem; }
.auth-status.error { color: var(--pathline-error); font-weight: 700; }
.auth-status.success { color: var(--pathline-success); font-weight: 700; }

.portal-shell { min-height: 100vh; background: #f7f5f1; }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; padding: 14px clamp(20px, 5vw, 70px); border-bottom: 1px solid var(--pathline-line); background: #fff; }
.portal-logo { width: 112px; }
.portal-logo img { display: block; width: 100%; }
.portal-header-actions { display: flex; align-items: center; gap: 20px; }
.portal-identity { color: var(--pathline-muted); font-size: 0.78rem; text-align: right; }
.portal-identity strong { display: block; color: var(--pathline-navy); }
.portal-identity span { text-transform: capitalize; }
.portal-signout { border: 0; background: transparent; color: var(--pathline-navy); cursor: pointer; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em; text-decoration: underline; text-underline-offset: 4px; text-transform: uppercase; }
.portal-main { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding: clamp(52px, 9vw, 110px) 0; }
.portal-status { color: var(--pathline-muted); }
.portal-status.error { color: var(--pathline-error); font-weight: 700; }
.portal-card { max-width: 760px; border-top: 4px solid var(--pathline-gold); background: #fff; padding: clamp(28px, 5vw, 54px); box-shadow: 0 18px 50px rgba(25, 39, 59, 0.08); }
.portal-card h1 { color: var(--pathline-navy); font-size: clamp(2.5rem, 6vw, 4.7rem); }
.portal-card > p:not(.auth-kicker) { color: var(--pathline-muted); font-size: 1.02rem; }
.portal-note { margin-top: 28px; padding: 20px; border-left: 3px solid var(--pathline-gold); background: var(--pathline-cream); }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: auto; padding: 28px 24px 34px; }
  .auth-brand-copy { margin: 44px 0 22px; }
  .auth-brand h1 { font-size: 2.8rem; }
  .auth-brand-copy p:last-child, .auth-brand-footer { display: none; }
  .auth-main { padding: 44px 22px 60px; }
}

@media (max-width: 560px) {
  .auth-links { align-items: flex-start; flex-direction: column; }
  .portal-header { align-items: flex-start; }
  .portal-header-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .portal-identity { display: none; }
}
