/* ============================================================
   MedSys auth pages (login, logged out, password reset)
   Extracted from login.html — the reference implementation of the
   design system for standalone pages. All four pages extend
   templates/registration/_auth_base.html and share this sheet, so a
   logout no longer drops the user into a different-looking product.
   Tokens mirror base.html's :root; fonts come from fonts.css.
   ============================================================ */
:root {
    --brand-500: #3B6FF2; --brand-600: #2563EB; --brand-700: #1D51CC; --brand-800: #1B43A6;
    --bg: #F4F6FA; --surface: #FFFFFF; --border-strong: #D2D8E3;
    --text: #131A26; --text-2: #5A6577; --text-3: #686E7B;
    --danger-fg: #C23934; --danger-bg: #FBEAE9; --danger-bd: #F2C9C7;
    --r-sm: 8px; --r-md: 10px; --r-xl: 18px;
    --brand-50: #EEF3FF;
    --success-fg: #0F7A45; --success-bg: #E5F6EC; --success-bd: #BCE6CD;
    --info-fg: #1D51CC; --info-bg: #E7EEFE; --info-bd: #C7D7FB;
    --ring: 0 0 0 3px rgba(37, 99, 235, .20);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
    margin: 0; min-height: 100vh; font-family: var(--font); color: var(--text);
    background: var(--bg); display: flex; align-items: center; justify-content: center;
    padding: 24px; -webkit-font-smoothing: antialiased;
}

.ms-login {
    width: 880px; max-width: 100%;
    background: var(--surface); border-radius: var(--r-xl); overflow: hidden;
    box-shadow: 0 18px 44px -12px rgba(19,26,38,.20), 0 6px 16px -8px rgba(19,26,38,.12);
    display: grid; grid-template-columns: 1fr 1fr;
}

/* ---- Brand panel ---- */
.ms-login__brand {
    position: relative; overflow: hidden; color: #fff; padding: 44px 40px;
    display: flex; flex-direction: column; justify-content: center;
    background: linear-gradient(155deg, var(--brand-500), var(--brand-800));
}
.ms-login__brand .blob { position: absolute; border-radius: 50%; }
.ms-login__brand .blob--1 { top: -40px; right: -40px; width: 180px; height: 180px; background: rgba(255,255,255,.08); }
.ms-login__brand .blob--2 { bottom: -60px; left: -30px; width: 200px; height: 200px; background: rgba(255,255,255,.06); }
.ms-login__brand-inner { position: relative; }
.ms-login__mark {
    width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
}
.ms-login__mark svg { width: 28px; height: 28px; }
.ms-login__name { font-size: 30px; font-weight: 780; letter-spacing: -.02em; margin-top: 20px; }
.ms-login__tag { font-size: 15px; opacity: .86; margin-top: 6px; max-width: 240px; line-height: 1.5; }
.ms-login__pill {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 22px; padding: 7px 13px;
    border-radius: 999px; background: rgba(255,255,255,.14); font-size: 12.5px; font-weight: 600;
}
.ms-login__pill svg { width: 15px; height: 15px; }

/* ---- Form panel ---- */
.ms-login__form { background: var(--surface); padding: 48px 44px; display: flex; flex-direction: column; justify-content: center; }
.ms-login__title { font-size: 24px; font-weight: 700; letter-spacing: -.015em; margin: 0; }
.ms-login__sub { font-size: 13px; color: var(--text-2); margin: 6px 0 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .form-control { padding-left: 36px; height: 44px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); }
.input-icon .form-control:focus { border-color: var(--brand-500); box-shadow: var(--ring); }
/* Keyboard focus: the same 2px brand outline base.html's design system uses (WCAG 1.4.11). */
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; }
.input-icon .form-control:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 1px; }

.ms-login__row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 18px; }
.ms-login__remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; margin: 0; }
.switch-input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .16s; flex-shrink: 0; display: inline-block; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(19,26,38,.18); transition: left .16s; }
.switch-input:checked + .switch { background: var(--brand-600); }
.switch-input:checked + .switch::after { left: 21px; }
.switch-input:focus-visible + .switch { box-shadow: var(--ring); outline: 2px solid var(--brand-600); outline-offset: 2px; }

.link { color: var(--brand-600); font-weight: 600; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; color: var(--brand-700); }

.btn-login {
    width: 100%; height: 46px; border: none; border-radius: var(--r-md); cursor: pointer;
    background: var(--brand-600); color: #fff; font-family: var(--font); font-size: 15px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background .14s, box-shadow .14s;
}
.btn-login:hover { background: var(--brand-700); }
.btn-login:focus-visible { box-shadow: var(--ring); }
.btn-login svg { width: 18px; height: 18px; transform: scaleX(-1); }

.ms-alert {
    display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 11px 13px;
    border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger-fg);
    border: 1px solid var(--danger-bd); font-size: 13px; font-weight: 500;
}
.ms-alert svg { width: 17px; height: 17px; flex-shrink: 0; }

.ms-login__foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; color: var(--text-3); font-size: 12px; }
.ms-login__foot svg { width: 14px; height: 14px; }
.ms-login__copy { text-align: center; margin-top: 6px; color: var(--text-3); font-size: 12px; }

@media (max-width: 760px) {
    body { padding: 0; }
    .ms-login { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; box-shadow: none; }
    .ms-login__brand { padding: 34px 28px; min-height: 200px; }
    .ms-login__form { padding: 30px 24px; }
}


/* ---- Variants used by the non-login pages ---- */
.ms-login__title--center { text-align: center; }
.ms-login__sub--center { text-align: center; }
.ms-login__icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600);
}
.ms-login__icon .material-symbols-outlined { font-size: 30px; }

.ms-alert--success { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-bd); }
.ms-alert--info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-bd); }
.ms-alert .material-symbols-outlined { font-size: 19px; flex-shrink: 0; }

.ms-tips {
  margin: 0 0 18px; padding: 14px 16px; border-radius: var(--r-sm);
  background: var(--bg); border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-2);
}
.ms-tips__title { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.ms-tips__title .material-symbols-outlined { font-size: 18px; color: var(--brand-600); }
.ms-tips ul { margin: 0; padding-left: 18px; }
.ms-tips li { margin-bottom: 4px; }

.btn-login .material-symbols-outlined { font-size: 20px; }
.btn-login--secondary {
  background: transparent; color: var(--brand-600); border: 1px solid var(--border-strong); margin-top: 10px;
}
.btn-login--secondary:hover { background: var(--bg); color: var(--brand-700); }

.form-control.ms-input {
  height: 44px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); padding: 0 14px;
}
.form-control.ms-input:focus { border-color: var(--brand-500); box-shadow: var(--ring); }
.field__error { font-size: 12.5px; color: var(--danger-fg); }
