/* HostelSense — login. Campus office, not a product splash. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Newsreader:ital,opsz,wght@0,6..72,500;0,6..72,650;1,6..72,500&display=swap");

:root {
  --bg: #e8dcc4;
  --panel: #f3ead6;
  --card: #fbf6ea;
  --ink: #221c18;
  --muted: #6b5d51;
  --line: #cbb99a;
  --maroon: #7a2e36;
  --maroon-deep: #5a2128;
  --brass: #9a7b4a;
  --olive: #243028;
  --olive-deep: #1a221c;
  --danger: #8b2e2e;
  --inside: #2f5a3c;
  --radius: 2px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
}

body {
  min-height: 100vh;
}

::selection {
  color: #fbf6ea;
  background: var(--maroon);
}

:focus-visible {
  outline: 2px solid var(--maroon);
  outline-offset: 2px;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--maroon);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--maroon-deep);
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) 1.08fr;
}

/* Left: painted hostel nameplate */
.brand-panel {
  position: relative;
  padding: 2.25rem 2rem;
  display: flex;
  background: var(--olive-deep);
  color: #f3ead6;
  border-right: 8px solid var(--maroon);
  overflow: hidden;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 1.1rem;
  border: 1px solid rgba(154, 123, 74, 0.45);
  pointer-events: none;
}

.brand-panel::after {
  display: none;
}

.brand-panel-inner {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  margin: auto 0 auto auto;
  padding-right: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: min(620px, 100%);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 2px !important;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 650;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: #f3ead6;
  background: var(--maroon);
  border: 1px solid #c9a15a;
  box-shadow: none;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-text strong {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: 0;
}

.logo-text span {
  font-size: 0.75rem;
  color: #cbb99a;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.brand-copy h1 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 2.45rem);
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 0.9rem;
  max-width: 14ch;
}

.brand-copy p {
  color: #d8ccb6;
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 34ch;
}

.brand-points {
  list-style: none;
  display: grid;
  gap: 0.7rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(154, 123, 74, 0.4);
}

.brand-points li {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  color: #e6d9c2;
  font-size: 0.9rem;
}

.brand-points .dot {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  box-shadow: none;
  flex-shrink: 0;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: #c9a15a;
  font-weight: 700;
}

.brand-points .dot::before {
  content: "—";
}

.brand-footer {
  margin-top: auto;
  font-size: 0.72rem;
  color: #cbb99a;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Right: paper form */
.form-panel {
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  background: var(--bg);
}

.form-card {
  width: min(420px, 100%);
  padding: 1.7rem 1.55rem 1.45rem;
  border-radius: 2px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 4px 5px 0 rgba(34, 28, 24, 0.08);
  position: relative;
}

.form-card::before {
  content: "HOSTEL OFFICE";
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--maroon);
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--maroon);
}

.form-header {
  margin-bottom: 1.15rem;
}

.form-header h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-weight: 650;
  letter-spacing: 0;
  margin-bottom: 0.25rem;
}

.form-header p {
  color: var(--muted);
  font-size: 0.9rem;
}

.role-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.role-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 0.3rem 0.7rem;
  border-radius: 0;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  margin-bottom: -1px;
}

.role-option:hover {
  color: var(--ink);
}

.role-option.active {
  color: var(--maroon);
  border-bottom-color: var(--maroon);
  background: transparent;
  box-shadow: none;
}

.role-option[data-role="parent"].active,
.role-option[data-role="warden"].active {
  border-color: transparent;
  border-bottom-color: var(--maroon);
  background: transparent;
  box-shadow: none;
}

.role-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  display: block;
  font-size: 0;
  line-height: 0;
  background: none !important;
  color: inherit;
}

.role-icon::before {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
}

.role-icon.student::before { content: "STU"; }
.role-icon.parent::before { content: "PAR"; }
.role-icon.warden::before { content: "WDN"; }

.role-label {
  font-size: 0.86rem;
  font-weight: 600;
}

.field {
  margin-bottom: 0.95rem;
}

.field label,
.label-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.label-row label {
  margin-bottom: 0;
}

.link-muted {
  font-size: 0.78rem;
  color: var(--muted);
}

.link-muted:hover {
  color: var(--maroon);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--muted);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  padding: 0.7rem 2.4rem 0.7rem 2.4rem;
  border-radius: 2px;
  border: 1px solid #b9a888;
  background: #fffdf7;
  outline: none;
}

.input-wrap input::placeholder {
  color: #9a8b78;
}

.input-wrap input:focus {
  border-color: var(--maroon);
  box-shadow: none;
}

.toggle-pass {
  position: absolute;
  right: 0.35rem;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.toggle-pass:hover {
  color: var(--ink);
  background: rgba(122, 46, 54, 0.06);
}

.remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin: 0.1rem 0 1rem;
  cursor: pointer;
  user-select: none;
}

.remember input {
  width: 15px;
  height: 15px;
  accent-color: var(--maroon);
}

.error-box {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 2px;
  background: #f8ece8;
  border: 1px solid #d7a39a;
  border-left: 3px solid var(--danger);
  color: var(--danger);
  font-size: 0.86rem;
}

.btn-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  border-radius: 2px;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #fbf6ea;
  background: var(--maroon);
  box-shadow: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-submit:hover {
  background: var(--maroon-deep);
  filter: none;
  transform: none;
}

.btn-submit:active {
  transform: none;
}

.btn-submit.success {
  background: var(--inside);
  box-shadow: none;
}

.btn-arrow {
  font-size: 1rem;
}

.btn-submit:hover .btn-arrow {
  transform: none;
}

.form-footnote {
  margin-top: 1rem;
  text-align: left;
  font-size: 0.8rem;
  color: var(--muted);
}

.demo-hint {
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-radius: 0;
  background: none;
  border: none;
  border-top: 1px dashed var(--line);
}

.demo-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maroon);
  background: none;
  padding: 0;
  border-radius: 0;
}

.demo-hint code {
  font-family: "IBM Plex Sans", ui-monospace, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--ink);
}

@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: auto;
    padding: 1.35rem 1.15rem 1.15rem;
    border-right: none;
    border-bottom: 8px solid var(--maroon);
  }

  .brand-panel::before {
    inset: 0.7rem;
  }

  .brand-panel-inner {
    width: 100%;
    margin: 0;
    padding-right: 0;
    min-height: 0;
    gap: 1rem;
  }

  .brand-copy h1 {
    max-width: none;
    font-size: 1.5rem;
  }

  .brand-points,
  .brand-footer {
    display: none;
  }

  .form-panel {
    padding: 1.15rem 1rem 2rem;
    place-items: start center;
  }

  .form-card {
    padding: 1.35rem 1.1rem 1.2rem;
    box-shadow: none;
  }
}

@media (max-width: 380px) {
  .role-label {
    font-size: 0.78rem;
  }
}

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