/* Sign-in: <main class="signin"> fills the window while signed out (the .device is hidden then).
   The real system's sign-in look: petrol with a brass heartbeat across the middle and two soft lights; the name
   كشفية with its shine; no clinic name, no test accounts. */
.signin {
  min-height: 100dvh; display: grid; place-items: center; padding: 16px; color: var(--ink); font: 400 var(--fs-2)/1.6 var(--font-ui);
  background: radial-gradient(900px 500px at 80% 10%, var(--brass-a16), transparent 60%), linear-gradient(160deg, var(--cover) 0%, var(--cover-2) 100%) fixed;
}
.signin .bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.signin .bg-ecg { position: absolute; top: 50%; inset-inline: 0; width: 100%; height: 140px; transform: translateY(-50%); opacity: .55; }
.signin .bg-ecg polyline {
  fill: none; stroke: var(--brass); stroke-width: 2.2; stroke-linejoin: round; stroke-dasharray: 2600; stroke-dashoffset: 2600;
  animation: ecg 4.5s linear infinite;
}
@keyframes ecg { 0% { stroke-dashoffset: 2600; } 55% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -2600; } }
.signin .blob { position: absolute; border-radius: var(--r-dot); filter: blur(60px); opacity: .35; animation: float 14s ease-in-out infinite alternate; }
.signin .blob.b1 { top: -80px; right: -60px; width: 380px; height: 380px; background: var(--signin-glow); }
.signin .blob.b2 { bottom: -90px; left: -40px; width: 320px; height: 320px; background: var(--brass); opacity: .18; animation-duration: 18s; }
@keyframes float { from { transform: translate(0, 0); } to { transform: translate(-60px, 50px); } }
@media (max-width: 600px) {
  .signin .bg-ecg { height: 90px; }
}

.signin .card {
  position: relative; z-index: 1; width: min(400px, 100%); padding: 30px 28px 18px; border-radius: var(--r-3);
  background: var(--signin-card); box-shadow: 0 30px 80px var(--black-a35);
}
.signin .brand { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.signin .brand::after {
  content: ""; width: 170px; height: 18px; margin-top: 2px;
  background: var(--ecg-brand) center / 100% 100% no-repeat;
}
.signin .name {
  position: relative; display: inline-block; padding-bottom: 10px; color: var(--cover);
  font: 700 var(--fs-mark-signin)/1.1 var(--font-name); animation: beat 7s ease-in-out 1.5s infinite;
}
.signin .name i { font-style: normal; color: var(--brass); }
.signin .name::after {
  content: attr(data-text); position: absolute; inset: 0; color: transparent; pointer-events: none;
  background: linear-gradient(100deg, transparent 38%, var(--signin-shine) 50%, transparent 62%) -50% 0 / 250% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; animation: shine 7s ease-in-out 1.5s infinite;
}
@keyframes shine { 0% { background-position: -50% 0; } 22%, 100% { background-position: 150% 0; } }
@keyframes beat { 0%, 24%, 100% { transform: scale(1); } 27% { transform: scale(1.06); } 30% { transform: scale(1); } 33% { transform: scale(1.03); } 36% { transform: scale(1); } }
.signin h1 { margin: 12px 0 14px; color: var(--muted); font-size: var(--fs-2); font-weight: 500; text-align: center; }
.signin form { display: flex; flex-direction: column; gap: 10px; }

/* its fields: taller and rounder than the screens' fields, a plain error line */
.signin .f { gap: 4px; }
.signin .f input { height: 46px; border-radius: var(--r-lift); }
.signin .f input:focus { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--signin-soft); }
.signin .f.bad input { box-shadow: 0 0 0 1px var(--rx); }
.signin .f.bad .err { display: block; font-weight: 400; line-height: inherit; }
.signin .f.bad .err::before { content: none; }
.signin .form-err { padding: 8px 14px; border-radius: var(--r-row); background: var(--rx-soft); color: var(--rx-ink); font-size: var(--fs-1); }
.signin .go-btn {
  height: 48px; margin-top: 6px; border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-2); font-weight: 600; box-shadow: 0 1px 2px var(--cover-a18); transition: background .12s, box-shadow .12s;
}
.signin .go-btn:hover { background: var(--accent-2); box-shadow: 0 4px 12px var(--cover-a22); }

/* a short wide window (a laptop at 200%, a phone on its side): the name beside the form, so nothing scrolls */
@media (max-height: 540px) and (min-width: 600px) {
  .signin .card {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "brand form" "title form";
    align-items: start; column-gap: 24px; width: min(640px, 100%); padding: 12px 24px 10px;
  }
  .signin .brand { grid-area: brand; }
  .signin .name { padding-bottom: 6px; font-size: var(--fs-mark-signin-sm); }
  .signin h1 { grid-area: title; margin: 2px 0 6px; }
  .signin form { grid-area: form; }
}
