/* Sign-in screen — self-contained, dependency-free. Dark, modern, professional. */

:root {
  --auth-bg: #0a0e1a;
  --auth-card: #10162a;
  --auth-card-2: #151d34;
  --auth-border: #232d49;
  --auth-text: #eaf0fb;
  --auth-muted: #8a97b6;
  --auth-faint: #5c6a8c;
  --brand-1: #6366f1; /* indigo */
  --brand-2: #8b5cf6; /* violet */
  --brand-3: #22d3ee; /* cyan   */
  --danger: #ff5d6c;
  --radius: 16px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--auth-bg);
  color: var(--auth-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

/* ---------------- Brand / marketing panel ---------------- */
.auth__brand {
  position: relative;
  overflow: hidden;
  padding: 56px 60px;
  display: flex;
  flex-direction: column;
  /* Centre the hero vertically so it lines up with the centred sign-in card on
     the right; the brand mark is pinned to the top-left, out of flow. */
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(99, 102, 241, 0.35), transparent 60%),
    radial-gradient(900px 500px at 90% 110%, rgba(34, 211, 238, 0.18), transparent 55%),
    linear-gradient(160deg, #0d1430 0%, #0a0f22 60%, #090c1a 100%);
  border-right: 1px solid var(--auth-border);
}

/* Soft animated orbs for depth */
.auth__brand::before,
.auth__brand::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  z-index: 0;
  animation: float 16s var(--ease) infinite alternate;
}
.auth__brand::before {
  width: 340px; height: 340px;
  background: radial-gradient(circle, var(--brand-2), transparent 70%);
  top: -60px; left: -40px;
}
.auth__brand::after {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--brand-3), transparent 70%);
  bottom: -80px; right: -20px;
  animation-delay: -6s;
}
@keyframes float {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(30px, -24px, 0) scale(1.12); }
}

.auth__brand > * { position: relative; z-index: 1; }

.brandmark { position: absolute; top: 56px; left: 60px; display: flex; align-items: center; gap: 12px; }
.brandmark .logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}
.brandmark .name { font-size: 20px; font-weight: 700; letter-spacing: 0.2px; }
.brandmark .name b { color: #fff; }
.brandmark .name span { color: var(--brand-3); }

.hero { max-width: 460px; }
.hero h1 {
  font-size: 38px; line-height: 1.15; margin: 0 0 16px;
  font-weight: 800; letter-spacing: -0.5px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand-3), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--auth-muted); font-size: 16px; line-height: 1.6; margin: 0 0 32px; }

.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.features li { display: flex; gap: 14px; align-items: flex-start; }
.features .tick {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; margin-top: 1px;
  background: rgba(99, 102, 241, 0.16); color: var(--brand-3);
}
.features .ftext strong { display: block; font-size: 14.5px; font-weight: 600; }
.features .ftext span { color: var(--auth-muted); font-size: 13.5px; }

.brand__foot { color: var(--auth-faint); font-size: 13px; }
.brand__foot b { color: var(--auth-muted); font-weight: 600; }

/* ---------------- Sign-in panel ---------------- */
.auth__panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 32px;
}
.card {
  width: 100%; max-width: 400px;
  animation: rise 0.6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card__mobilebrand { display: none; }

.card h2 { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.3px; }
.card .sub { color: var(--auth-muted); font-size: 14.5px; margin: 0 0 28px; }

.field { margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600; color: var(--auth-muted);
  margin-bottom: 7px; letter-spacing: 0.2px;
}
.input {
  position: relative; display: flex; align-items: center;
  background: var(--auth-card-2);
  border: 1px solid var(--auth-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input:focus-within {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
  background: #172140;
}
.input .icon { flex: none; display: grid; place-items: center; padding: 0 10px 0 12px; color: var(--auth-faint); }
.input input {
  flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  color: var(--auth-text); font-size: 14.5px; padding: 12px 12px 12px 0;
}
.input input::placeholder { color: var(--auth-faint); }
.input .toggle {
  flex: none; background: transparent; border: 0; color: var(--auth-faint);
  cursor: pointer; padding: 0 12px; height: 100%; display: grid; place-items: center;
}
.input .toggle:hover { color: var(--auth-muted); }

.btn {
  width: 100%; border: 0; cursor: pointer; border-radius: var(--radius-sm);
  padding: 13px 16px; font-size: 15px; font-weight: 650; color: #fff;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.38);
  transition: transform 0.12s var(--ease), box-shadow 0.18s, filter 0.18s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 6px;
}
.btn:hover { filter: brightness(1.06); box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.7; cursor: default; filter: none; box-shadow: none; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: spin 0.7s linear infinite; display: none;
}
.btn.loading .spinner { display: inline-block; }
.btn.loading .label { opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  color: var(--danger); font-size: 13.5px; min-height: 18px;
  margin: 14px 2px 0; display: flex; align-items: center; gap: 7px;
}
.error:empty { margin-top: 0; }
.error.shake { animation: shake 0.4s var(--ease); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}

.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--auth-faint); font-size: 12px; letter-spacing: 0.6px;
  text-transform: uppercase; margin: 26px 0 16px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--auth-border); }

.demo { display: grid; gap: 9px; }
.demo__chip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; width: 100%;
  background: var(--auth-card-2); border: 1px solid var(--auth-border);
  border-radius: var(--radius-sm); padding: 11px 14px; cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
}
.demo__chip:hover { border-color: var(--brand-1); background: #16203c; transform: translateY(-1px); }
.demo__chip .who strong { display: block; font-size: 13.5px; }
.demo__chip .who span { font-size: 12px; color: var(--auth-muted); }
.tag {
  flex: none; font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  padding: 4px 9px; border-radius: 999px;
}
.tag.vendor_admin { background: rgba(139, 92, 246, 0.16); color: #c4b5fd; }
.tag.institute_admin { background: rgba(34, 211, 238, 0.14); color: #7dd3fc; }
.tag.user { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }

.foot-note {
  margin-top: 22px; color: var(--auth-faint); font-size: 12.5px; line-height: 1.5;
  text-align: center;
}
.foot-note svg { vertical-align: -2px; margin-right: 4px; }

.hint { margin: -4px 2px 14px; color: var(--auth-faint); font-size: 12px; line-height: 1.4; }

.auth-switch {
  margin-top: 22px; text-align: center; color: var(--auth-muted); font-size: 13.5px;
}
.auth-switch a { color: var(--brand-3); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* Legal line under the sign-in card (the brand panel is hidden on mobile). */
.copyright { margin: 22px 0 0; color: var(--auth-faint); font-size: 12px; text-align: center; }

.ok-note {
  display: none; margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.4);
  color: #6ee7b7; font-size: 13.5px; line-height: 1.5;
}
.ok-note.show { display: block; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .card__mobilebrand {
    display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px;
  }
  .card__mobilebrand .logo { width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-1), var(--brand-2)); }
  .card__mobilebrand .name { font-weight: 700; font-size: 18px; }
  .card__mobilebrand .name span { color: var(--brand-3); }
}

@media (prefers-reduced-motion: reduce) {
  .auth__brand::before, .auth__brand::after, .card, .spinner, .error.shake { animation: none; }
}
