/* Sign-in shell: a device scene on the left, a pill-shaped form on the right.
 *
 * Plain CSS rather than Tailwind utilities because the illustration is drawn
 * with layered gradients and absolutely positioned shapes — clearer to read (and
 * cheaper to build) than arbitrary-value utility soup.
 */

.auth-shell {
  display: flex;
  min-height: 100vh;
  background: #ffffff;
}

/* --------------------------------------------------------------- scene side */

.auth-brand {
  position: relative;
  display: none;
  flex: 1 1 58%;
  overflow: hidden;
  padding: 2.5rem 3rem;
  background:
    radial-gradient(80% 70% at 20% 15%, #e0e7ff 0%, transparent 60%),
    radial-gradient(70% 70% at 90% 85%, #ccfbf1 0%, transparent 60%),
    linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
}

/* Blueprint grid, faded out towards the edges. */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(99, 102, 241, 0.09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(99, 102, 241, 0.09) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(75% 65% at 45% 45%, #000 15%, transparent 90%);
  pointer-events: none;
}

.auth-brand__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 42rem;
  height: 100%;
  margin: 0 auto;
}

.auth-brand__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-brand__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: linear-gradient(140deg, #38bdf8, #6366f1);
  box-shadow: 0 12px 24px -12px rgba(79, 70, 229, 0.7);
  font-weight: 800;
  color: #0b1220;
}

.auth-brand__name {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #0f172a;
}

.auth-brand__tagline {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #6366f1;
}

.auth-brand__caption {
  margin: auto 0 0;
  max-width: 22rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #64748b;
}

/* ------------------------------------------------------------ device scene */

.auth-scene {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 1.5rem 0;
}

/* Soft light under the devices so they do not float on a flat background. */
.auth-scene::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8%;
  width: 70%;
  height: 45%;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: radial-gradient(closest-side, rgba(99, 102, 241, 0.16), transparent 100%);
  filter: blur(6px);
  pointer-events: none;
}

/* The devices share a positioning box so the phone always sits on the laptop's
   corner, whatever the panel width. */
.auth-devices {
  position: relative;
  z-index: 1;
  width: min(36rem, 96%);
}

.auth-laptop {
  position: relative;
  width: 100%;
  transform: rotate(-1.4deg);
}

.auth-laptop__screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  padding: 0.7rem;
  border-radius: 0.9rem;
  background: #0b1220;
  box-shadow: 0 40px 60px -30px rgba(15, 23, 42, 0.55), 0 0 0 1px rgba(15, 23, 42, 0.6);
}

/* Lid hinge. */
.auth-laptop__base {
  width: 112%;
  height: 0.7rem;
  margin-left: -6%;
  border-radius: 0 0 0.9rem 0.9rem;
  background: linear-gradient(#cbd5e1, #94a3b8);
  box-shadow: 0 18px 24px -18px rgba(15, 23, 42, 0.5);
}

.ui-topbar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  height: 1.35rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem 0.5rem 0 0;
  background: #111c30;
}

.ui-dot {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 9999px;
  background: #475569;
}

.ui-topbar__pill {
  width: 4.5rem;
  height: 0.42rem;
  margin-left: auto;
  border-radius: 9999px;
  background: #334155;
}

.ui-body {
  display: flex;
  gap: 0.5rem;
  height: calc(100% - 1.35rem);
  padding: 0.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
  background: #f8fafc;
}

.ui-nav {
  flex: 0 0 18%;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.45rem 0.35rem;
  border-radius: 0.45rem;
  background: #0f172a;
}

.ui-nav__line {
  height: 0.34rem;
  border-radius: 9999px;
  background: #334155;
}

.ui-nav__line--active {
  background: #6366f1;
}

.ui-main {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 0.4rem;
}

.ui-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.ui-tile {
  aspect-ratio: 1 / 1;
  display: grid;
  /* The art fills the leftover row; a percentage height would collapse inside a
     grid item whose height comes from the aspect ratio. */
  grid-template-rows: 1fr auto auto;
  gap: 0.22rem;
  padding: 0.35rem;
  border-radius: 0.45rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.ui-tile__art {
  border-radius: 0.3rem;
  background: linear-gradient(140deg, #c7d2fe, #a5b4fc);
}

.ui-tile:nth-child(2n) .ui-tile__art {
  background: linear-gradient(140deg, #bae6fd, #7dd3fc);
}

.ui-tile:nth-child(3n) .ui-tile__art {
  background: linear-gradient(140deg, #bbf7d0, #86efac);
}

.ui-tile__line {
  height: 0.22rem;
  border-radius: 9999px;
  background: #e2e8f0;
}

.ui-tile__price {
  width: 55%;
  height: 0.28rem;
  border-radius: 9999px;
  background: #6366f1;
}

.ui-cart {
  flex: 0 0 26%;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  padding: 0.45rem;
  border-radius: 0.45rem;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.ui-cart__line {
  display: grid;
  gap: 0.2rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px dashed #e2e8f0;
}

.ui-cart__line span {
  height: 0.22rem;
  border-radius: 9999px;
  background: #e2e8f0;
}

.ui-cart__line span:last-child {
  width: 45%;
  background: #cbd5e1;
}

.ui-cart__total {
  height: 0.6rem;
  margin-top: 0.15rem;
  border-radius: 9999px;
  background: linear-gradient(120deg, #4f46e5, #6366f1);
}

/* Phone overlapping the laptop's lower right corner. */
.auth-phone {
  position: absolute;
  z-index: 2;
  right: -0.5rem;
  bottom: -2.75rem;
  width: 7.6rem;
  padding: 0.3rem;
  border-radius: 1.1rem;
  background: #0b1220;
  box-shadow: 0 30px 40px -22px rgba(15, 23, 42, 0.6);
  transform: rotate(4deg);
}

.auth-phone__notch {
  width: 40%;
  height: 0.22rem;
  margin: 0.1rem auto 0.3rem;
  border-radius: 9999px;
  background: #334155;
}

.auth-phone__screen {
  display: grid;
  gap: 0.28rem;
  padding: 0.45rem 0.4rem 0.7rem;
  border-radius: 0.85rem;
  background: #f8fafc;
}

.auth-phone__title {
  height: 0.3rem;
  border-radius: 9999px;
  background: #0f172a;
}

.auth-phone__line {
  height: 0.22rem;
  border-radius: 9999px;
  background: #e2e8f0;
}

.auth-phone__line--short {
  width: 60%;
}

.auth-phone__total {
  height: 0.85rem;
  margin-top: 0.2rem;
  border-radius: 9999px;
  background: linear-gradient(120deg, #10b981, #34d399);
}

/* ------------------------------------------------------- form side (right) */

.auth-main {
  display: flex;
  flex: 1 1 44%;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 2.5rem 1.5rem;
}

.auth-main__inner {
  width: 100%;
  max-width: 23rem;
  margin-right: 0;
}

/* Compact brand header shown where the scene is hidden. */
.auth-compact {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.auth-compact__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 9999px;
  background: linear-gradient(140deg, #38bdf8, #6366f1);
  color: #0b1220;
  font-weight: 800;
}

.auth-compact__name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.auth-heading {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.auth-subheading {
  margin: 0.35rem 0 1.5rem;
  font-size: 0.88rem;
  color: #64748b;
}

.auth-field {
  margin-bottom: 0.75rem;
}

/* Pill fields: the whole control is a rounded capsule. */
.auth-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: 3rem;
  padding: 0 1rem;
  border: 1px solid #d7dbe7;
  border-radius: 9999px;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-pill:focus-within {
  border-color: var(--brand, #4f46e5);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.14);
}

.auth-pill__icon {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  color: #94a3b8;
}

.auth-pill__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 0.92rem;
  color: #0f172a;
}

.auth-pill__input:focus {
  outline: none;
}

.auth-pill__input::placeholder {
  color: #94a3b8;
}

.auth-reveal {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
}

.auth-reveal:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid #fecdd3;
  border-radius: 1rem;
  background: #fff1f2;
  font-size: 0.85rem;
  color: #9f1239;
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.5rem 0 1.35rem;
  font-size: 0.85rem;
}

.auth-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #475569;
}

.auth-link {
  color: var(--brand, #4f46e5);
  font-weight: 600;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3rem;
  border: 0;
  border-radius: 9999px;
  background: var(--brand, #4f46e5);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

.auth-submit:hover {
  filter: brightness(0.94);
}

.auth-submit:active {
  transform: translateY(1px);
}

.auth-hint {
  margin: 1.1rem 0 0;
  font-size: 0.76rem;
  color: #94a3b8;
}

.auth-signup {
  margin-top: 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #475569;
}

.auth-foot {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Show the scene from large tablets upwards; phones get the compact head. */
@media (min-width: 1024px) {
  .auth-brand {
    display: flex;
  }

  .auth-main {
    padding: 3rem 4rem;
  }

  .auth-compact {
    display: none;
  }
}

@media (max-width: 1360px) {
  .auth-phone {
    right: -0.75rem;
  }
}
