/*
 * Defines the responsive visual system for the login page.
 * The split layout distinguishes account access from the external destination.
 */

:root {
  color-scheme: light;
  --ink: #15241f;
  --muted: #64716c;
  --paper: #f7f5ee;
  --surface: #fffefa;
  --forest: #173f35;
  --forest-light: #25594b;
  --accent: #e2a94b;
  --border: #d9ddd6;
  --error: #a23d32;
  --success: #237153;
  --shadow: 0 24px 70px rgba(21, 36, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 245, 238, 0.86), rgba(247, 245, 238, 0.96)),
    repeating-linear-gradient(45deg, #d8d9cb 0 1px, transparent 1px 12px);
  font-family: "DM Sans", sans-serif;
}

button,
input {
  font: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.88fr) minmax(360px, 1.12fr);
  width: min(1060px, calc(100% - 48px));
  min-height: 650px;
  margin: max(32px, calc((100vh - 650px) / 2)) auto;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(21, 36, 31, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.welcome-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  padding: 48px;
  overflow: hidden;
  color: #f8f6ef;
  background:
    radial-gradient(
      circle at 80% 18%,
      rgba(226, 169, 75, 0.24) 0 2px,
      transparent 3px
    ),
    linear-gradient(145deg, var(--forest-light), var(--forest));
}

.welcome-panel::after {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 320px;
  height: 320px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px rgba(255, 255, 255, 0.04),
    0 0 0 96px rgba(255, 255, 255, 0.025);
  content: "";
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--forest);
  background: var(--accent);
  border-radius: 4px;
  font-family: "Newsreader", serif;
  font-size: 21px;
}

.welcome-copy {
  position: relative;
  z-index: 1;
  max-width: 390px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.welcome-copy h1,
.form-heading h2 {
  margin: 0;
  font-family: "Newsreader", serif;
  font-weight: 600;
}

.welcome-copy h1 {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  line-height: 0.98;
}

.welcome-copy > p:last-child {
  max-width: 28ch;
  margin: 20px 0 0;
  color: rgba(248, 246, 239, 0.72);
  font-size: 1.05rem;
  line-height: 1.6;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 64px clamp(36px, 8vw, 100px);
}

.login-form {
  width: min(100%, 420px);
}

.form-heading {
  margin-bottom: 36px;
}

.form-heading h2 {
  font-size: 2.45rem;
  line-height: 1.1;
}

.form-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
}

.field {
  display: grid;
  margin-bottom: 20px;
}

.field label {
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input::placeholder {
  color: #98a19d;
}

.field input:focus {
  border-color: var(--forest-light);
  box-shadow: 0 0 0 3px rgba(37, 89, 75, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  min-height: 18px;
  margin-top: 5px;
  color: var(--error);
  font-size: 0.78rem;
}

.remember-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 2px 0 26px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.86rem;
}

.remember-option input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--forest-light);
}

button {
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  color: #ffffff;
  background: var(--forest);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 700;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

button:hover {
  background: var(--forest-light);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid rgba(226, 169, 75, 0.5);
  outline-offset: 3px;
}

.form-status {
  min-height: 22px;
  margin: 16px 0 0;
  color: var(--success);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 760px) {
  .page-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 560px);
    margin: 12px auto;
  }

  .welcome-panel {
    min-height: 290px;
    padding: 28px;
  }

  .welcome-copy h1 {
    font-size: 3rem;
  }

  .welcome-copy > p:last-child {
    margin-top: 12px;
  }

  .login-panel {
    padding: 42px 28px 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
