@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ==========================================================================
   dawa.ai sign-in
   A full-screen medical-technology background with the sign-in card floating
   at the exact centre. One surface: no columns, no panels, no divider.
   All motion is CSS transform/opacity - no JS animation loop.
   ========================================================================== */

:root {
  --ink: #0F172A;
  --ink-2: #475569;
  --muted-green: #5B7C68;

  --primary: #15803D;
  --primary-hover: #166534;
  --secondary: #16A34A;
  --accent: #22C55E;
  --light: #DCFCE7;
  --vlight: #F0FDF4;
  --base: #F8FFFA;

  --field-border: #DCE7DF;
  --placeholder: #94A3B8;
  --danger: #DC2626;

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

.auth-body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================================== the surface */

.auth {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, #FFFFFF 0%, #F2FCF6 15%, #E2F5EA 42%, #D2EDDC 70%, #C6E7D2 100%);
}

/* ------------------------------------------------------------ backdrop */

.auth__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  animation: bg-in 1.1s var(--ease) both;
}

/* faint grid, fading out towards the edges */
.auth__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(21, 128, 61, .075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 128, 61, .075) 1px, transparent 1px);
  background-size: 54px 54px;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 82%);
  mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 82%);
}

/* the illumination the card sits on */
.bg-glow {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(1000px, 92vw);
  height: min(760px, 88vh);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 255, 255, .95) 0%,
    rgba(220, 252, 231, .55) 38%,
    rgba(34, 197, 94, .07) 62%,
    transparent 78%);
  animation: glow-breathe 9s ease-in-out infinite;
}

/* ------------------------------------------------------- background art */

/*
 * A medical-technology scene: molecular structures, capsules, tablets,
 * flowing curves and a glowing ECG.
 *
 * Every piece is its OWN absolutely-positioned SVG. An earlier version drew
 * them into one full-bleed SVG with preserveAspectRatio="slice", which scaled
 * 1.45x and cropped 325px off each side - the molecules and pills ended up
 * entirely off-screen. Positioning each element in CSS removes that class of
 * bug and makes placement exact at any viewport size.
 */

/* --------------------------------------------------------- curves */

.waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #15803D;
  stroke-width: 2;
  stroke-linecap: round;
}

.wave {
  opacity: .22;
  animation: wave-drift 22s ease-in-out infinite;
}

.wave--2 { opacity: .17; animation-duration: 28s; animation-delay: -7s; }
.wave--3 { opacity: .14; animation-duration: 34s; animation-delay: -14s; }
.wave--4 { opacity: .12; animation-duration: 26s; animation-delay: -4s; }

@keyframes wave-drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-26px, 14px, 0); }
}

/* ------------------------------------------------------ molecules */

.mol {
  position: absolute;
  fill: none;
  stroke: #15803D;
  stroke-width: 2.2;
  opacity: .38;
  overflow: visible;
  animation: mol-float 18s ease-in-out infinite;
}

.mol .v { fill: #15803D; stroke: none; opacity: .85; }

/* Deliberate slots in the left and right margins plus the top and bottom
   strips. Spaced so no two shapes stack - piling them up was what made the
   scene read as clutter rather than composition. */
.mol--1 { left: 3%;   top: 6%;    width: clamp(120px, 14vw, 200px); animation-delay: 0s; }
.mol--2 { left: 4%;   top: 57%;   width: clamp(95px, 10.5vw, 150px); animation-delay: -6s; opacity: .3; }
.mol--3 { right: 3%;  top: 8%;    width: clamp(122px, 14.3vw, 205px); animation-delay: -3s; }
.mol--4 { right: 4%;  top: 59%;   width: clamp(98px, 10.8vw, 155px); animation-delay: -9s; opacity: .3; }

@keyframes mol-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(5deg); }
}

/* --------------------------------------------- capsules, tablets */

/* These are lit objects, not outlines - the fills and highlights live in the
   SVG gradients, so CSS only handles placement, opacity and drift. */
.cap,
.tab {
  position: absolute;
  overflow: visible;
  opacity: .8;
  animation: pill-bob 16s ease-in-out infinite;
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* lower edge - the densest band, as in the reference */
.cap--1 { left: 6%;   bottom: 6%;  width: clamp(78px, 8.6vw, 122px); rotate: -16deg; animation-delay: 0s; }
.cap--2 { left: 34%;  bottom: 1%;  width: clamp(70px, 7.6vw, 106px); rotate: 8deg;   animation-delay: -4s; }
.cap--3 { right: 6%;  bottom: 7%;  width: clamp(76px, 8.4vw, 118px); rotate: 21deg;  animation-delay: -8s; }
.cap--4 { right: 34%; bottom: 1%;  width: clamp(68px, 7.4vw, 103px); rotate: -11deg; animation-delay: -12s; }
.cap--5 { left: 22%;  top: 29%;    width: clamp(64px, 7vw, 96px);    rotate: 34deg;  animation-delay: -6s; opacity: .62; }

.tab--1 { left: 24%;  top: 51%;    width: clamp(38px, 4.2vw, 58px); animation-delay: -2s; }
.tab--2 { right: 24%; top: 49%;    width: clamp(36px, 4vw, 56px);   animation-delay: -5s; }
.tab--3 { left: 20%;  bottom: 19%; width: clamp(34px, 3.8vw, 53px); animation-delay: -9s; opacity: .66; }
.tab--4 { right: 21%; bottom: 21%; width: clamp(35px, 3.9vw, 55px); animation-delay: -13s; opacity: .66; }

@keyframes pill-bob {
  0%, 100% { translate: 0 0; }
  50%      { translate: 0 -14px; }
}

/* ------------------------------------------------------------ ECG */

.ecg {
  position: absolute;
  left: 0;
  right: 0;
  top: 55%;
  width: 100%;
  height: clamp(120px, 17vh, 185px);
}

/* the constant baseline */
.ecg__trace { opacity: .28; }

/* the bright beat sweeping along it */
.ecg__line {
  stroke-dasharray: 300 3000;
  stroke-dashoffset: 300;
  opacity: .95;
  filter: drop-shadow(0 0 7px rgba(34, 197, 94, .95));
  animation: ecg-sweep 6.5s linear infinite;
}

@keyframes ecg-sweep {
  from { stroke-dashoffset: 300; }
  to   { stroke-dashoffset: -3000; }
}

/* ------------------------------------------------- medical symbols */

.sym {
  position: absolute;
  color: rgba(21, 128, 61, .34);
  line-height: 1;
  animation: sym-float 15s ease-in-out infinite;
}

.sym--1 { left: 20%;  top: 10%;    font-size: clamp(20px, 2.2vw, 31px); animation-delay: 0s; }
.sym--2 { right: 20%; top: 12%;    font-size: clamp(21px, 2.3vw, 33px); animation-delay: -2s; }
.sym--3 { left: 3%;   top: 41%;    font-size: clamp(26px, 2.9vw, 41px); animation-delay: -4s; }
.sym--4 { right: 3%;  top: 43%;    font-size: clamp(25px, 2.8vw, 39px); animation-delay: -6s; }
.sym--5 { left: 30%;  bottom: 11%; font-size: clamp(19px, 2.1vw, 29px); animation-delay: -8s; }
.sym--6 { right: 30%; bottom: 12%; font-size: clamp(20px, 2.2vw, 31px); animation-delay: -10s; }
.sym--7 { left: 26%;  bottom: 33%; font-size: clamp(21px, 2.3vw, 33px); animation-delay: -12s; }

@keyframes sym-float {
  0%, 100% { transform: translateY(0) rotate(0deg);     opacity: .62; }
  50%      { transform: translateY(-20px) rotate(6deg); opacity: 1; }
}

/* ============================================================ the card */

.auth__card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 40px 38px 36px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(21, 128, 61, .12);
  box-shadow: 0 25px 80px rgba(20, 83, 45, .12);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  animation: card-in .62s var(--ease) .12s both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.auth__logo { margin-bottom: 20px; }
.auth__logo img { max-height: 46px; width: auto; }

.auth__title {
  margin: 0 0 6px;
  font-size: clamp(26px, 2.5vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
  color: var(--ink);
}

.auth__sub {
  margin: 0 0 26px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted-green);
}

/* ---------------------------------------------------------- fields */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

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

.input-ico {
  position: absolute;
  left: 16px;
  font-size: 19px;
  color: var(--primary);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 48px 0 46px;
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  background: #FFFFFF;
  font-family: var(--font);
  font-size: 15.5px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}

.input-wrap input::placeholder { color: var(--placeholder); font-weight: 400; }

.input-wrap input:hover { border-color: #C6D8CC; }

.input-wrap input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .1);
}

.pw-toggle {
  position: absolute;
  right: 7px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #8FA79A;
  font-size: 19px;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}

.pw-toggle:hover { color: var(--primary); background: var(--vlight); }
.pw-toggle:focus-visible { outline: 2px solid var(--secondary); outline-offset: 1px; }

.field-error {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -4px 0 14px;
  padding: 10px 13px;
  border-radius: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
}

/* --------------------------------------------------------- buttons */

.btn-primary,
.btn-ghost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 54px;
  padding: 0 18px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease),
              background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}

.btn-primary {
  border: none;
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 24px rgba(21, 128, 61, .2);
}

.btn-primary i { font-size: 20px; transition: transform .2s var(--ease); }

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(21, 128, 61, .28);
}

.btn-primary:hover i { transform: translateX(4px); }
.btn-primary:active { transform: translateY(0); }

.btn-primary:disabled,
.btn-primary.is-loading { opacity: .7; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary.is-loading i { animation: btn-pulse .9s ease-in-out infinite; }

@keyframes btn-pulse {
  0%, 100% { opacity: .35; }
  50%      { opacity: 1; }
}

.btn-ghost {
  background: rgba(255, 255, 255, .82);
  border: 1.5px solid var(--field-border);
  color: var(--ink);
}

.btn-ghost i { font-size: 19px; color: var(--primary); }

.btn-ghost:hover {
  border-color: var(--primary);
  background: var(--vlight);
  color: var(--primary-hover);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible { outline: 3px solid rgba(21, 128, 61, .42); outline-offset: 2px; }

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: #93A99C;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.or::before,
.or::after { content: ""; flex: 1; height: 1px; background: var(--field-border); }

.auth__foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--ink-2);
}

.auth__foot a { color: var(--primary); font-weight: 700; text-decoration: none; }
.auth__foot a:hover { text-decoration: underline; }

/* ======================================================== responsive */

/* Tablet: the card takes ~60% of the width, so the mid-height slots are no
   longer clear. Those elements are dropped or moved into the outer margins. */
@media only screen and (max-width: 991.98px) {
  .auth__card { max-width: 460px; padding: 36px 30px 32px; }

  .mol--2,
  .mol--4,
  .cap--5,
  .tab--1,
  .tab--2,
  .sym--7 { display: none; }

  .cap--3 { right: 3%; bottom: 10%; }
  .tab--3 { left: 6%;  bottom: 30%; }
  .tab--4 { right: 6%; bottom: 32%; }

  .ecg { top: 58%; }
}

/* Mobile: the card is nearly full-bleed, so only the top and bottom strips
   are usable - anything at mid-height would sit on the fields. */
@media only screen and (max-width: 575.98px) {
  .auth { padding: 20px 16px; }

  .auth__card { max-width: 100%; padding: 28px 22px 26px; border-radius: 20px; }

  .input-wrap input { font-size: 16px; }   /* stops iOS Safari zooming */

  .auth__logo { margin-bottom: 16px; }
  .auth__sub { margin-bottom: 22px; }

  .cap--2,
  .cap--4,
  .tab--3,
  .tab--4,
  .sym--3,
  .sym--4 { display: none; }

  /* the molecules frame the top corners, half off the edge */
  .mol--1 { left: -17%;  top: -3%; width: 122px; opacity: .2; }
  .mol--3 { right: -17%; top: -3%; width: 126px; opacity: .2; }

  .cap--1 { left: 2%;  bottom: 1%; width: 84px; rotate: -14deg; }
  .cap--3 { right: 2%; bottom: 1%; width: 82px; rotate: 18deg; }

  /* clear of the corner molecules */
  .sym--1 { left: 30%;  top: 2%;    font-size: 21px; }
  .sym--2 { right: 30%; top: 2%;    font-size: 21px; }
  /* the bottom capsules own the corners, so these sit inboard of them */
  .sym--5 { left: 32%;  bottom: 3%; font-size: 20px; }
  .sym--6 { right: 32%; bottom: 3%; font-size: 20px; }

  .ecg { top: 60%; height: 96px; }

  .auth__bg::before { background-size: 42px 42px; }
}

/* Very small screens: the card fills the viewport, so the scene has nowhere
   to sit. Keep the wash, waves and ECG only. */
@media only screen and (max-width: 400px) and (max-height: 660px) {
  .auth__card { padding: 24px 18px 22px; }
  .mol, .cap, .tab, .sym { display: none !important; }
}

/* Short landscape phones */
@media only screen and (max-height: 520px) and (orientation: landscape) {
  .mol, .cap, .tab, .sym { display: none !important; }
  .auth { padding: 14px 16px; }
}

/* ===================================================== accessibility */

@media (prefers-reduced-motion: reduce) {
  .auth__bg,
  .bg-glow,
  .wave,
  .mol,
  .cap,
  .tab,
  .ecg__line,
  .sym,
  .auth__card,
  .btn-primary.is-loading i {
    animation: none !important;
  }

  /* a still medical scene rather than a blank one */
  .ecg__line { stroke-dasharray: none; stroke-dashoffset: 0; opacity: .4; }
  .auth__bg, .auth__card { opacity: 1; transform: none; }
}
