/* Chem Lab Pro — Auth (adapts via chem-themes tokens) */

body.chem-lab .auth-page,
body.chemistry-pro .auth-page {
  padding: 40px 0 72px;
  position: relative;
  z-index: 1;
}

body.chem-lab .auth-card,
body.chemistry-pro .auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-strong);
}

body.chem-lab .auth-grid,
body.chemistry-pro .auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 540px;
}

body.chem-lab .auth-formPane,
body.chemistry-pro .auth-formPane {
  padding: 36px 32px 40px;
  background: var(--card-bg);
  color: var(--text);
}

body.chem-lab .auth-step,
body.chemistry-pro .auth-step { display: none; }

body.chem-lab .auth-head,
body.chemistry-pro .auth-head { margin-bottom: 24px; }

body.chem-lab .auth-head__logo,
body.chemistry-pro .auth-head__logo {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--page-bg);
  display: grid;
  place-items: center;
}

body.chem-lab .auth-head__logo img,
body.chemistry-pro .auth-head__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.chem-lab .auth-head__logoFallback,
body.chemistry-pro .auth-head__logoFallback {
  font-size: 1.6rem;
  color: var(--primary);
}

body.chem-lab .auth-head__title,
body.chemistry-pro .auth-head__title {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-strong);
}

body.chem-lab .auth-head__sub,
body.chemistry-pro .auth-head__sub {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.98rem;
  font-weight: 500;
}

body.chem-lab .auth-form,
body.chemistry-pro .auth-form {
  display: grid;
  gap: 14px;
}

body.chem-lab .fgrid,
body.chemistry-pro .fgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.chem-lab .field,
body.chemistry-pro .field { display: grid; gap: 6px; }

body.chem-lab .label,
body.chemistry-pro .label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-strong);
}

body.chem-lab .input,
body.chemistry-pro .input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--field-border);
  background: var(--field-bg);
  color: var(--field-text);
  font-family: inherit;
  font-size: 0.98rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}

body.chem-lab .input:focus,
body.chemistry-pro .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--brand-weak);
}

body.chem-lab .hint,
body.chemistry-pro .hint {
  font-size: 0.82rem;
  color: var(--muted);
}

body.chem-lab .btn-submit,
body.chemistry-pro .btn-submit {
  margin-top: 6px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--btn-solid-bg);
  color: var(--btn-solid-text);
  font-weight: 800;
  font-size: 1.02rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 10px 28px var(--chem-glow);
  transition: transform .2s ease, box-shadow .2s ease;
}

body.chem-lab .btn-submit:hover,
body.chemistry-pro .btn-submit:hover {
  transform: translateY(-2px);
}

body.chem-lab .auth-foot,
body.chemistry-pro .auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}

body.chem-lab .auth-link,
body.chemistry-pro .auth-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

body.chem-lab .auth-link:hover,
body.chemistry-pro .auth-link:hover { text-decoration: underline; }

body.chem-lab .auth-imgPane,
body.chemistry-pro .auth-imgPane {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background: var(--hero-bg);
}

body.chem-lab .auth-img,
body.chemistry-pro .auth-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  display: block;
  min-height: 540px;
}

body.chem-lab .auth-imgFallback,
body.chemistry-pro .auth-imgFallback {
  min-height: 540px;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  color: var(--hero-muted);
  padding: 32px;
}

body.chem-lab .auth-imgFallback__hero,
body.chemistry-pro .auth-imgFallback__hero {
  font-size: 4.5rem;
  line-height: 1;
  color: var(--hero-accent);
}

body.chem-lab .auth-imgPane__brand,
body.chemistry-pro .auth-imgPane__brand {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 28px 24px;
  display: grid;
  gap: 4px;
}

body.chem-lab .auth-imgPane__brand strong,
body.chemistry-pro .auth-imgPane__brand strong {
  font-size: 1.25rem;
  font-weight: 800;
}

body.chem-lab .auth-imgPane__brand span,
body.chemistry-pro .auth-imgPane__brand span {
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  body.chem-lab .auth-grid,
  body.chemistry-pro .auth-grid { grid-template-columns: 1fr; }
  body.chem-lab .auth-imgPane,
  body.chemistry-pro .auth-imgPane {
    order: -1;
    min-height: 220px;
  }
  body.chem-lab .auth-img,
  body.chemistry-pro .auth-img,
  body.chem-lab .auth-imgFallback,
  body.chemistry-pro .auth-imgFallback { min-height: 220px; }
  body.chem-lab .fgrid,
  body.chemistry-pro .fgrid { grid-template-columns: 1fr; }
  body.chem-lab .auth-formPane,
  body.chemistry-pro .auth-formPane { padding: 28px 20px 36px; }
}

/* ═══════════════════════════════════════════════════════════════
   رسائل التسجيل / تسجيل الدخول (Toasts)
   ═══════════════════════════════════════════════════════════════ */
.phy-toast {
  --toast-accent: var(--success);
  --toast-duration: 6000ms;
  --toast-ease: cubic-bezier(.22, 1, .36, 1);
  --toast-bounce: cubic-bezier(.34, 1.45, .64, 1);
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 24px;
  z-index: 10000;
  width: min(440px, calc(100vw - 28px));
  max-width: 440px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 17px 18px 19px;
  border-radius: var(--radius-lg, 18px);
  background: var(--card-bg-strong, var(--card-bg, #fff));
  border: 1px solid var(--border, rgba(0,0,0,.12));
  border-inline-start: 4px solid var(--toast-accent);
  box-shadow: var(--shadow-strong, 0 22px 48px rgba(20, 8, 34, 0.18));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateX(-50%);
  animation: authToastIn .38s var(--toast-bounce) both;
  overflow: hidden;
  color: var(--text, #1a1028);
  font-family: inherit;
}

.phy-toast--top {
  bottom: auto;
  top: max(88px, calc(env(safe-area-inset-top, 0px) + 74px));
}

.phy-toast--success { --toast-accent: var(--success, #1F7A52); }
.phy-toast--error { --toast-accent: var(--danger, #C0392B); }

.phy-toast__icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--toast-accent);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--toast-accent) 34%, transparent);
}

.phy-toast__body { min-width: 0; flex: 1; }

.phy-toast__title {
  display: block;
  font-weight: 800;
  color: var(--text-strong, #0E0618);
  font-size: 1rem;
  line-height: 1.45;
}

.phy-toast__msg {
  margin: 4px 0 0;
  color: var(--muted-strong, var(--muted, #3A2A4E));
  font-size: 14px;
  line-height: 1.7;
  font-weight: 500;
}

.phy-toast__list {
  margin: 7px 0 0;
  padding-inline-start: 19px;
  color: var(--muted-strong, var(--muted, #3A2A4E));
  font-size: 14px;
  line-height: 1.75;
  font-weight: 500;
}

.phy-toast__list li + li { margin-top: 2px; }

.phy-toast__close {
  width: 30px;
  height: 30px;
  margin-inline-start: auto;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 9px;
  background: var(--surface-soft, rgba(91, 44, 138, 0.06));
  border: 1px solid var(--border, rgba(0,0,0,.12));
  font-size: 19px;
  line-height: 1;
  color: var(--muted, #3A2A4E);
  cursor: pointer;
}

.phy-toast__close:hover {
  color: var(--text-strong, #0E0618);
  border-color: var(--border-strong, rgba(91, 44, 138, 0.35));
}

.phy-toast__progress {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
  overflow: hidden;
  border-end-start-radius: var(--radius-lg, 18px);
  border-end-end-radius: var(--radius-lg, 18px);
}

.phy-toast__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--toast-accent);
  transform-origin: right;
  animation: phyToastBar var(--toast-duration) linear forwards;
}

.phy-toast.is-paused .phy-toast__progress span { animation-play-state: paused; }
.phy-toast.is-leaving {
  animation: authToastOut .32s var(--toast-ease) both;
  pointer-events: none;
}

@keyframes phyToastBar {
  to { transform: scaleX(0); }
}

@keyframes authToastIn {
  from { opacity: 0; transform: translate(-50%, -16px) scale(.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes authToastOut {
  to { opacity: 0; transform: translate(-50%, -12px) scale(.97); }
}

@keyframes authToastMobileIn {
  from { opacity: 0; transform: translate(-50%, 24px) scale(.97); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes authToastMobileOut {
  to { opacity: 0; transform: translate(-50%, 20px) scale(.98); }
}

@media (max-width: 560px) {
  .phy-toast,
  .phy-toast--top {
    top: auto;
    bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 10px));
    width: min(440px, calc(100% - 20px));
    max-width: calc(100dvw - 20px);
    max-width: none;
    max-height: min(46vh, 330px);
    padding: 15px 14px 18px;
    gap: 11px;
    border-radius: 18px;
    animation: authToastMobileIn .36s var(--toast-bounce) both;
  }
  .phy-toast.is-leaving { animation: authToastMobileOut .3s var(--toast-ease) both; }
  .phy-toast__body {
    max-height: min(38vh, 260px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .phy-toast__icon { width: 34px; height: 34px; font-size: 17px; }
  .phy-toast__title { font-size: 15px; line-height: 1.5; }
  .phy-toast__msg,
  .phy-toast__list { font-size: 13px; line-height: 1.7; }
  .phy-toast__list { margin-top: 5px; padding-inline-start: 17px; }
  .phy-toast__close { width: 32px; height: 32px; border-radius: 10px; }
}
