:root {
  --pc-cream: #f7f3ea;
  --pc-cream-2: #fffdf8;
  --pc-line: #e7ded0;
  --pc-ink: #191813;
  --pc-muted: #8b8577;
  --pc-gold: #9b7f36;
  --pc-gold-soft: #c8b477;
  --pc-error: #a94442;
  --pc-shadow: 0 14px 34px rgba(25, 24, 19, 0.07);

  --login-image: none;
}

/* ================= PAGE (fits screen, no scroll) ================= */
.login-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--pc-cream);
}

/* ================= LEFT PANEL ================= */
.login-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 40px;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(
      700px 320px at 10% -8%,
      rgba(200, 180, 119, 0.16),
      transparent 70%
    ),
    var(--pc-cream);
}

.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: 16px;
}
.login-card {
  width: 100%;
  max-width: 460px;
  box-sizing: border-box;
  padding: 26px 32px;
  background: var(--pc-cream-2);
  border: 1px solid var(--pc-line);
  border-radius: 16px;
  box-shadow: var(--pc-shadow);
}

.login-eyebrow {
  font-family: "Jost";
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pc-muted);
  margin: 0 0 4px;
}
.login-title {
  font-family: "Playfair Display";
  font-weight: 700;
  font-size: 20px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--pc-ink);
  margin: 0 0 6px;
}
.login-sub {
  font-family: "Jost";
  font-size: 14.5px;
  color: #6b665a;
  margin: 0 0 16px;
}

/* floating-label fields */
.field {
  position: relative;
}
.field input {
  width: 100%;
  height: 50px;
  box-sizing: border-box;
  padding: 16px 44px 0 16px;
  border: 1px solid var(--pc-line);
  border-radius: 8px;
  background: #fff;
  font-family: "Jost";
  font-size: 15px;
  color: var(--pc-ink);
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.field input:hover {
  border-color: #d9cdae;
}
.field input:focus {
  border-color: var(--pc-gold);
  box-shadow: 0 0 0 4px rgba(155, 127, 54, 0.12);
}
.field label {
  position: absolute;
  left: 12px;
  top: 25px;
  transform: translateY(-50%);
  padding: 0 4px;
  font-family: "Jost";
  font-size: 15px;
  color: var(--pc-muted);
  background: transparent;
  pointer-events: none;
  transform-origin: left center;
  transition:
    top 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease,
    background 0.2s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 12px;
  background: #fff;
  color: var(--pc-gold);
}
.field.has-error input {
  border-color: var(--pc-error);
}
.field.has-error input:focus + label,
.field.has-error input:not(:placeholder-shown) + label {
  color: var(--pc-error);
}

.field-error {
  min-height: 14px;
  margin: 2px 2px 2px;
  font-family: "Jost";
  font-size: 12px;
  color: var(--pc-error);
}

.pw-toggle {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--pc-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 8px;
  transition: color 0.2s ease;
}
.pw-toggle:hover {
  color: var(--pc-ink);
}

.forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 2px 10px;
}
.link-strong {
  font-family: "Jost";
  font-weight: 600;
  font-size: 13.5px;
  color: var(--pc-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}
.link-strong:hover {
  color: var(--pc-ink);
  border-color: var(--pc-ink);
}

.form-error {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f8e9e8;
  border: 1px solid #e8c4c2;
  color: var(--pc-error);
  font-family: "Jost";
  font-size: 13px;
}
.form-error[hidden] {
  display: none;
}

/* submit */
.login-submit {
  width: 100%;
  height: 48px;
  border: 1px solid var(--pc-ink);
  border-radius: 999px;
  background: var(--pc-ink);
  color: #f5f1ea;
  font-family: "Jost";
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease;
}
.login-submit:hover:not(:disabled) {
  background: var(--pc-gold-soft);
  border-color: var(--pc-gold-soft);
  color: #000;
}
.login-submit:disabled {
  background: #e6e1d6;
  border-color: #e6e1d6;
  color: #9c9384;
  cursor: not-allowed;
}
.login-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}
.login-submit.is-loading .login-spinner {
  display: inline-block;
}
.login-submit.is-loading {
  pointer-events: none;
}
@keyframes loginSpin {
  to {
    transform: rotate(360deg);
  }
}

.login-links {
  margin-top: 16px;
  text-align: center;
}
.login-links p {
  margin: 0 0 6px;
  font-family: "Jost";
  font-size: 14px;
  color: #6b665a;
}
.login-links .link-strong {
  margin-left: 4px;
}

.login-help {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--pc-line);
  font-family: "Jost";
  font-size: 13px;
  color: var(--pc-muted);
}

/* footer */
.login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 0 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Jost";
  font-weight: 500;
  font-size: 14px;
  color: var(--pc-ink);
  text-decoration: none;
  transition: color 0.2s ease;
}
.back-link:hover {
  color: var(--pc-gold);
}

/* ================= RIGHT PANEL ================= */
.login-visual {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  background:
    linear-gradient(
      180deg,
      rgba(25, 24, 19, 0) 35%,
      rgba(25, 24, 19, 0.72) 100%
    ),
    var(--login-image),
    radial-gradient(
      900px 600px at 80% 10%,
      rgba(200, 180, 119, 0.28),
      transparent 65%
    ),
    #191813;
  background-size: cover;
  background-position: center;
}
.login-visual-inner {
  padding: 0 48px 48px;
}
.login-wordmark {
  font-family: "Playfair Display";
  font-weight: 900;
  font-size: clamp(44px, 5.4vw, 88px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: #f5f1ea;
  margin: 0 0 16px;
}
.login-wordmark span {
  color: var(--pc-gold-soft);
}
.login-pill {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid rgba(200, 180, 119, 0.55);
  border-radius: 999px;
  background: rgba(25, 24, 19, 0.35);
  color: var(--pc-gold-soft);
  font-family: "Jost";
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1000px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .login-visual {
    display: none;
  }
  .login-panel {
    padding: 0 28px;
  }
}
@media (max-width: 520px) {
  .login-panel {
    padding: 0 16px;
  }
  .login-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .login-title {
    font-size: 26px;
  }
  .login-foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Very short screens (e.g. landscape phones): allow scroll so nothing gets cut */
@media (max-height: 640px) {
  .login-page {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-spinner {
    animation-duration: 2s;
  }
  .field label,
  .login-submit {
    transition: none;
  }
}
