/* Shared look for the sign-in pages: login, reset request, set new password */
:root {
  --red: #9D2222;
  --red-dark: #7A1A1A;
  --red-tint: #FCF5F5;
  --ink: #1C1C1C;
  --muted: #7A7A7A;
  --line: #DADADA;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: 'Bai Jamjuree', sans-serif;
  color: var(--ink);
  background:
    url('../img/loginback.svg') no-repeat bottom center / 1400px auto,
    linear-gradient(180deg, #FFFFFF 10%, var(--red-tint) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Brand bar */
.brand {
  display: flex; align-items: center; gap: 14px;
  padding: 28px 40px 18px; margin: 0 40px;
  width: fit-content; min-width: 320px;
  background: linear-gradient(to right, #8C8C8C, transparent) no-repeat bottom left / 100% 2px;
  text-decoration: none;
}
.brand img { height: 44px; width: auto; }
.brand span { font-size: 17px; font-weight: 500; letter-spacing: .3px; color: rgba(0,0,0,.85); }

/* Centered card */
main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 16px 80px; }
.card {
  width: 100%; max-width: 440px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px);
  border: 1px solid #EEE;
  border-top: 4px solid var(--red);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(157,34,34,.10), 0 2px 8px rgba(0,0,0,.05);
  padding: 40px 40px 32px;
  animation: rise .5s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } }

.card h1 {
  margin: 0 0 6px; text-align: center;
  font-size: 28px; line-height: 1.2; font-weight: 600; font-style: italic; color: var(--red);
}
.card .sub { margin: 0 0 30px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }

/* Fields */
.field { margin-bottom: 20px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.input-wrap { position: relative; }
.input-wrap svg.lead { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: #A5A5A5; pointer-events: none; transition: fill .2s; }
.field input {
  width: 100%; height: 50px; padding: 0 46px 0 44px;
  font: inherit; font-size: 15px; color: var(--ink);
  background: #FAFAFA; border: 1.5px solid var(--line); border-radius: 12px;
  outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input::placeholder { color: #B3B3B3; }
.field input:focus { background: #fff; border-color: var(--red); box-shadow: 0 0 0 4px rgba(157,34,34,.12); }
.input-wrap:focus-within svg.lead { fill: var(--red); }
.field.has-error input { border-color: var(--red); background: #FFF8F8; }
.field-error { margin-top: 6px; font-size: 12.5px; color: var(--red); }

/* Show / hide password */
.peek {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; border-radius: 8px; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.peek:hover, .peek:focus-visible { background: #F1F1F1; outline: none; }
.peek svg { width: 18px; height: 18px; fill: #8A8A8A; }

.forgot { display: block; margin-top: 8px; text-align: right; font-size: 13px; color: var(--muted); text-decoration: none; }
.forgot:hover { color: var(--red); text-decoration: underline; }

/* Button */
.btn {
  width: 100%; height: 50px; margin-top: 8px;
  font: inherit; font-size: 16px; font-weight: 600; letter-spacing: .4px; color: #fff;
  background: var(--red); border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 6px 16px rgba(157,34,34,.25);
  transition: background .2s, transform .1s, box-shadow .2s;
}
.btn:hover { background: var(--red-dark); box-shadow: 0 8px 20px rgba(157,34,34,.32); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(157,34,34,.35); outline-offset: 2px; }

/* Messages */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 22px; padding: 12px 14px;
  font-size: 13.5px; line-height: 1.4; color: var(--red);
  background: #F8EAEA; border: 1px solid #EBCACA; border-radius: 10px;
}
.alert svg { flex: 0 0 18px; width: 18px; height: 18px; fill: var(--red); margin-top: 1px; }
.alert.info { color: #444; background: #F4F4F4; border-color: #E2E2E2; }
.alert.info svg { fill: #777; }

/* Footer links */
.foot { margin-top: 24px; padding-top: 18px; border-top: 1px solid #EFEFEF; text-align: center; font-size: 13px; color: var(--muted); }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--red); text-decoration: underline; }
.foot .sep { margin: 0 8px; color: #CFCFCF; }

@media (max-width: 560px) {
  .brand { margin: 0 16px; padding: 22px 0 14px; min-width: 0; width: auto; }
  .brand img { height: 36px; }
  .card { padding: 32px 22px 26px; border-radius: 14px; }
  .card h1 { font-size: 23px; }
}
