@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #1b2421;
  --muted: #68716b;
  --paper: #f3f0e9;
  --line: #dedbd2;
  --green: #1d3831;
  --green-deep: #152923;
  --copper: #bd8751;
  --error: #9e3b32;
  --success: #24614b;
  font-family: "DM Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(440px, 1.08fr);
  min-height: 100vh;
  background: #faf9f6;
}

.brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(30px, 5vw, 72px);
  color: #f6f2e9;
  background-color: var(--green);
  background-image: linear-gradient(145deg, rgba(21, 41, 35, 0.16), rgba(15, 31, 26, 0.72)), repeating-linear-gradient(128deg, transparent 0 42px, rgba(240, 235, 220, 0.035) 43px 44px);
}

.brand-panel::after {
  position: absolute;
  right: -180px;
  bottom: 10%;
  width: 440px;
  height: 440px;
  border: 1px solid rgba(225, 202, 164, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(225, 202, 164, 0.035), 0 0 0 72px rgba(225, 202, 164, 0.025);
  content: "";
}

.wordmark { z-index: 1; display: inline-flex; width: fit-content; align-items: center; gap: 12px; color: inherit; font-size: 17px; font-weight: 600; text-decoration: none; }
.brand-mark { display: grid; width: 34px; aspect-ratio: 1; place-items: center; border: 1px solid rgba(240, 232, 214, 0.6); border-radius: 50%; color: #ead2ae; font-family: "Playfair Display", Georgia, serif; font-size: 19px; }
.brand-copy { z-index: 1; max-width: 510px; margin: auto 0; padding: 54px 0; }
.eyebrow, .form-kicker { margin: 0; color: #d3b48e; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.brand-copy h1 { margin: 22px 0 18px; font-family: "Playfair Display", Georgia, serif; font-size: clamp(42px, 5.2vw, 70px); font-weight: 500; line-height: 1.08; }
.brand-note { max-width: 350px; margin: 0; color: rgba(246, 242, 233, 0.72); font-size: 16px; line-height: 1.7; }
.campus-stamp { z-index: 1; display: flex; align-items: center; gap: 13px; color: rgba(246, 242, 233, 0.7); font-size: 10px; letter-spacing: 1.1px; }
.campus-stamp span:first-child { color: #e4c49b; font-weight: 700; }
.stamp-line { width: 38px; height: 1px; background: rgba(246, 242, 233, 0.45); }

.form-panel { display: grid; min-height: 100vh; place-items: center; padding: 48px clamp(28px, 7vw, 104px); }
.form-content { width: min(100%, 430px); animation: form-rise 500ms ease-out both; }
.form-kicker { color: #93724d; }
.form-content h2 { margin: 14px 0 7px; font-family: "Playfair Display", Georgia, serif; font-size: 36px; font-weight: 600; letter-spacing: 0; }
.form-subtitle { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 30px 0 22px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #f1efe9; }
.mode-tab { min-height: 40px; border: 0; border-radius: 6px; background: transparent; color: #66706a; font-size: 13px; font-weight: 600; transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease; }
.mode-tab.active { background: #fff; color: var(--green-deep); box-shadow: 0 1px 3px rgba(35, 41, 36, 0.12); }
.notice { margin: 0 0 18px; padding: 11px 13px; border: 1px solid #d5d9d2; border-radius: 7px; background: #f2f5f0; color: #3e5146; font-size: 13px; line-height: 1.5; }
.notice.error { border-color: #e5c7c1; background: #fbf0ee; color: var(--error); }
.notice.success { border-color: #c5dace; background: #eef6f0; color: var(--success); }
.field { display: grid; gap: 8px; margin: 0 0 17px; }
.field[hidden] { display: none; }
.field label { color: #303a34; font-size: 12px; font-weight: 700; }
.field input { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid #d9d8d1; border-radius: 7px; outline: none; background: #fff; color: var(--ink); font-size: 14px; transition: border-color 150ms ease, box-shadow 150ms ease; }
.field input::placeholder { color: #a0a49d; }
.field input:focus { border-color: #597469; box-shadow: 0 0 0 3px rgba(66, 105, 88, 0.12); }
.field-hint { color: #7a817b; font-size: 11px; line-height: 1.4; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 68px; }
.visibility-toggle { position: absolute; top: 50%; right: 12px; transform: translateY(-50%); border: 0; background: transparent; color: #68756c; font-size: 11px; font-weight: 700; }
.submit-button { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: center; gap: 10px; margin-top: 24px; border: 0; border-radius: 7px; background: var(--green); color: #fff; font-size: 13px; font-weight: 700; transition: background 160ms ease, transform 160ms ease; }
.submit-button:hover:not(:disabled) { transform: translateY(-1px); background: #26483d; }
.submit-button:disabled { cursor: wait; opacity: 0.8; }
.button-spinner { width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
.button-spinner[hidden] { display: none; }
.return-link { display: block; margin-top: 16px; color: var(--success); font-size: 13px; font-weight: 700; text-align: center; }
.return-link[hidden] { display: none; }
.form-footnote { margin: 26px 0 0; color: #8a8f89; font-size: 11px; text-align: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes form-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: minmax(250px, 0.8fr) minmax(390px, 1.2fr); }
  .brand-panel { padding: 32px; }
  .form-panel { padding: 40px 32px; }
  .brand-copy h1 { font-size: 48px; }
}

@media (max-width: 640px) {
  .auth-layout { display: block; }
  .brand-panel { min-height: 0; padding: 24px 24px 28px; }
  .brand-copy { padding: 34px 0 25px; }
  .brand-copy h1 { margin: 12px 0 8px; font-size: 39px; }
  .brand-note { max-width: 300px; font-size: 13px; }
  .campus-stamp { font-size: 9px; }
  .brand-panel::after { right: -260px; bottom: -180px; }
  .form-panel { min-height: auto; padding: 34px 24px 42px; }
  .form-content h2 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}