/* =========================================================
   nuvisco — Client Login
   login-page.css
   Login-specific styles. Loaded after home-page-css.css so
   it can reuse the design tokens (--bg, --ink, --accent…),
   the .field floating-label inputs, .btn, .nav, .footer and
   the custom-cursor rules defined there.
   ========================================================= */

/* ===== Login-specific focus styles ===== */
.login :focus-visible {
  outline: 2px solid var(--accent, #ff5b2e);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== Modal focus management ===== */
.modal.is-open {
  display: flex !important;
}
.modal[aria-hidden="true"] {
  display: none !important;
}

/* ===== Login Section ===== */
.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 150px 0 90px;
  background: var(--bg);
  overflow: hidden;
  z-index: 2;
}

/* Grid background — same treatment as the hero */
.login__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
  opacity: 0.5;
  z-index: 1;
}

/* Ambient radial glows — echoes the contact section's ::before */
.login__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  z-index: 1;
  pointer-events: none;
}
.login__glow--1 {
  width: 540px;
  height: 540px;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.22), transparent 60%);
  top: -140px;
  right: -90px;
}
.login__glow--2 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(255, 91, 46, 0.18), transparent 60%);
  bottom: -160px;
  left: -110px;
}

/* ===== Login Card ===== */
.login__card {
  position: relative;
  z-index: 3;
  width: min(440px, 92vw);
  padding: 48px 44px 40px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: cardIn 0.9s var(--ease) both;
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brand mark inside the card */
.login__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
}

.login__eyebrow {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 18px;
}

.login__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 14px;
}
.login__title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login__sub {
  text-align: center;
  color: var(--ink-dim);
  font-size: 1rem;
  margin-bottom: 38px;
}

/* ===== Form ===== */
.login__form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* .field / .field input / .field label come from home-page-css.css.
   A gentle accent glow on focus gives the inputs a little life. */
.login__form .field input:focus {
  box-shadow: 0 6px 24px rgba(255, 91, 46, 0.08);
}

/* Forgot password row */
.login__row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: -4px;
}

/* Custom checkbox */
.login__check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--ink-dim);
  user-select: none;
}
.login__check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.login__check-box {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  transition: border-color 0.3s, background 0.3s;
  flex-shrink: 0;
}
.login__check-box::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid var(--bg);
  border-bottom: 2px solid var(--bg);
  transform: rotate(-45deg) scale(0);
  transition: transform 0.2s var(--ease);
  margin-top: -2px;
}
.login__check input:checked + .login__check-box {
  background: var(--accent);
  border-color: var(--accent);
}
.login__check input:checked + .login__check-box::after {
  transform: rotate(-45deg) scale(1);
}
.login__check input:focus-visible + .login__check-box {
  border-color: var(--accent-3);
}
.login__check:hover .login__check-box {
  border-color: var(--ink-dim);
}

.login__forgot {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink-dim);
  padding: 0;
  transition: color 0.3s;
}
.login__forgot:hover {
  color: var(--accent);
}

/* Submit button — full width */
.login__form .btn {
  width: 100%;
  margin-top: 10px;
}

/* Divider */
.login__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 32px 0 22px;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.login__divider::before,
.login__divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Alt link */
.login__alt {
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-dim);
}
.login__alt a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, color 0.3s;
}
.login__alt a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Back to home */
.login__back {
  display: flex;
  justify-content: center;
  margin-top: 26px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  transition: color 0.3s;
}
.login__back:hover {
  color: var(--ink);
}

/* ===== Forgot Password Modal ===== */
/* z-index sits just below the custom cursor (10000) so the cursor
   stays visible over the dialog. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
/* Lock background scroll while the dialog is open */
body.modal-open {
  overflow: hidden;
}
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 11, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal__card {
  position: relative;
  z-index: 2;
  width: min(440px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 44px 40px 36px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.4s var(--ease);
}
.modal.is-open .modal__card {
  transform: translateY(0) scale(1);
}
.modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink-dim);
  transition: color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.modal__close:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: rotate(90deg);
}
.modal__close svg {
  width: 14px;
  height: 14px;
}
.modal__eyebrow {
  display: block;
  text-align: center;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-3);
  margin-bottom: 16px;
}
.modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 14px;
}
.modal__title em {
  font-style: italic;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal__sub {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.98rem;
  margin-bottom: 30px;
}
.modal__sub strong {
  color: var(--ink);
  font-weight: 500;
  word-break: break-all;
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.modal__form .btn {
  width: 100%;
  margin-top: 8px;
}
.modal__back {
  display: block;
  width: 100%;
  margin-top: 22px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink-dim);
  text-align: center;
  transition: color 0.3s;
}
.modal__back:hover {
  color: var(--ink);
}
/* Success step */
.modal__body--success {
  text-align: center;
}
.modal__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(46, 230, 196, 0.4);
  color: var(--accent-3);
  box-shadow: 0 0 30px rgba(46, 230, 196, 0.12) inset;
}
.modal__icon svg {
  width: 28px;
  height: 28px;
}
.modal__body--success .btn {
  width: 100%;
  margin-top: 4px;
}
.modal__note {
  margin-top: 20px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .login__card {
    padding: 40px 26px 32px;
  }
  .login__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .login__card {
    animation: none;
  }
}

/* ===== Toast Notifications ===== */
/* Fixed top-center glass notification that replaces native alert() boxes.
   z-index lives above everything including modals (9999) and cursors (10000). */
.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 10010;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(420px, 92vw);
  padding: 18px 20px 18px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.45s var(--ease), opacity 0.45s var(--ease), visibility 0.45s;
  overflow: hidden;
}
.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.toast__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--accent);
  background: rgba(255, 91, 46, 0.08);
}
.toast__icon svg {
  width: 20px;
  height: 20px;
}
/* Variant: error (red) */
.toast--error .toast__icon {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.35);
  background: rgba(255, 107, 107, 0.1);
}
.toast--error {
  border-color: rgba(255, 107, 107, 0.3);
}
/* Variant: success (teal) */
.toast--success .toast__icon {
  color: var(--accent-3);
  border-color: rgba(46, 230, 196, 0.4);
  background: rgba(46, 230, 196, 0.1);
}
.toast--success {
  border-color: rgba(46, 230, 196, 0.3);
}
/* Variant: warning (amber) */
.toast--warning .toast__icon {
  color: #ffb74d;
  border-color: rgba(255, 183, 77, 0.35);
  background: rgba(255, 183, 77, 0.1);
}
.toast--warning {
  border-color: rgba(255, 183, 77, 0.3);
}
.toast__body {
  flex: 1;
  min-width: 0;
}
.toast__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 3px;
}
.toast__msg {
  font-size: 0.86rem;
  color: var(--ink-dim);
  line-height: 1.45;
}
.toast__close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--muted);
  transition: color 0.3s, background 0.3s;
}
.toast__close:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}
.toast__close svg {
  width: 14px;
  height: 14px;
}
/* Auto-dismiss progress bar */
.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
}
.toast__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(1);
}
.toast--error .toast__progress span { background: #ff6b6b; }
.toast--success .toast__progress span { background: var(--accent-3); }
.toast--warning .toast__progress span { background: #ffb74d; }
.toast.is-visible .toast__progress span {
  animation: toastProgress 5s linear forwards;
}
@keyframes toastProgress {
  to { transform: scaleX(0); }
}

/* ===== Reset Password Modal extras ===== */
.modal__error {
  margin-top: -6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 107, 0.3);
  background: rgba(255, 107, 107, 0.08);
  color: #ff8a8a;
  font-size: 0.86rem;
  line-height: 1.45;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal__error::before {
  content: "!";
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  font-weight: 700;
  font-size: 0.8rem;
}
.modal__error[hidden] {
  display: none;
}

/* Shake animation for inline form errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.is-shake {
  animation: shake 0.4s var(--ease);
}

/* Toast responsive */
@media (max-width: 480px) {
  .toast {
    top: 16px;
    width: calc(100vw - 32px);
    padding: 16px 16px 16px 14px;
  }
}
