/* ============================================================
   Lexoft — Auth (Google quick sign-up) — injected globally
   ============================================================ */

/* Header auth control */
.auth-ctl { display: flex; align-items: center; flex-shrink: 0; }
.auth-login-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; padding: 9px 16px;
  border-radius: var(--r-sm); background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(27,95,204,.25); transition: .16s; white-space: nowrap;
}
.auth-login-btn:hover { background: var(--accent-dark); box-shadow: 0 4px 14px rgba(27,95,204,.3); transform: translateY(-1px); }
.auth-login-btn svg { width: 16px; height: 16px; }

/* Logged-in avatar + menu */
.auth-user { position: relative; }
.auth-avatar {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  background: linear-gradient(140deg, #2E6FD6, #133A82);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
  border: 2px solid #fff; box-shadow: var(--sh-1); transition: .15s;
}
.auth-avatar:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-menu {
  position: absolute; top: calc(100% + 10px); right: 0; width: 244px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--sh-3); padding: 8px; z-index: 130; display: none;
}
.auth-menu.open { display: block; }
.auth-menu-head { display: flex; align-items: center; gap: 11px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.auth-menu-head .am-av { width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(140deg, #2E6FD6, #133A82); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.auth-menu-head .am-name { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.auth-menu-head .am-email { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; word-break: break-all; }
.auth-menu a, .auth-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  font-size: 14px; font-weight: 500; color: var(--ink-2); padding: 9px 10px; border-radius: 7px; transition: .12s;
}
.auth-menu a:hover, .auth-menu button:hover { background: var(--bg-2); color: var(--accent); }
.auth-menu svg { width: 17px; height: 17px; color: var(--ink-4); flex-shrink: 0; }
.auth-menu a:hover svg, .auth-menu button:hover svg { color: var(--accent); }
.auth-menu .am-sep { height: 1px; background: var(--line); margin: 6px 0; }
.auth-menu .am-signout:hover { background: var(--red-soft); color: var(--red); }
.auth-menu .am-signout:hover svg { color: var(--red); }

/* ============================================================
   Modal
   ============================================================ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,27,45,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; transition: opacity .2s;
}
.auth-overlay.show { opacity: 1; }
.auth-modal {
  width: 100%; max-width: 420px; background: #fff; border-radius: var(--r-xl);
  box-shadow: var(--sh-3); padding: 36px 34px 28px; position: relative;
  transform: translateY(8px) scale(.99); transition: transform .22s; max-height: 90vh; overflow-y: auto;
}
.auth-overlay.show .auth-modal { transform: none; }
.auth-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--ink-3); transition: .14s; }
.auth-close:hover { background: var(--bg-2); color: var(--ink); }
.auth-close svg { width: 19px; height: 19px; }

.auth-step { animation: authFade .25s ease; }
@keyframes authFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-logo { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px; }
.auth-logo .lm { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(150deg, var(--accent), var(--accent-darker)); display: grid; place-items: center; }
.auth-logo .lm svg { width: 18px; height: 18px; }
.auth-logo .lw { font-weight: 800; font-size: 19px; letter-spacing: -.02em; color: var(--ink); }
.auth-logo .lw b { color: var(--accent); }

.auth-modal h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.18; }
.auth-modal .auth-sub { font-size: 15px; color: var(--ink-2); margin-top: 9px; line-height: 1.55; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%;
  background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px;
  padding: 13px; font-size: 15.5px; font-weight: 600; color: #3C4043; margin-top: 22px; transition: .15s;
}
.google-btn:hover { background: #F8FAFD; border-color: var(--ink-4); box-shadow: var(--sh-1); }
.google-btn svg { width: 19px; height: 19px; }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; }
.auth-divider::before, .auth-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.auth-divider span { font-size: 11.5px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em; }

.auth-benefits { display: flex; flex-direction: column; gap: 11px; }
.auth-benefits li { display: flex; gap: 11px; font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.auth-benefits li svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; margin-top: 1px; }

.auth-fineprint { font-size: 11.5px; color: var(--ink-4); line-height: 1.5; margin-top: 22px; text-align: center; }
.auth-fineprint a { color: var(--ink-3); text-decoration: underline; }

/* Google account chooser (simplified mock) */
.g-head { display: flex; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.g-head svg { width: 22px; height: 22px; }
.g-head span { font-size: 14px; color: var(--ink-3); font-weight: 500; }
.g-title { font-size: 19px; font-weight: 700; color: var(--ink); }
.g-desc { font-size: 14px; color: var(--ink-2); margin-top: 6px; margin-bottom: 18px; }
.g-accounts { display: flex; flex-direction: column; gap: 2px; }
.g-account { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; padding: 12px 8px; border-radius: 9px; transition: .12s; }
.g-account:hover { background: var(--bg-2); }
.g-account .ga-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.g-account .ga-name { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.g-account .ga-email { font-size: 13px; color: var(--ink-3); margin-top: 1px; }
.g-account.add .ga-av { background: var(--bg-3); color: var(--ink-3); }
.g-account.add .ga-name { color: var(--ink-2); font-weight: 500; }

/* Loading */
.auth-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 0 40px; }
.auth-spinner { width: 44px; height: 44px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: authSpin .8s linear infinite; }
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-loading p { font-size: 15px; color: var(--ink-2); margin-top: 20px; font-weight: 500; }

/* Success */
.auth-success { text-align: center; padding: 24px 0 8px; }
.auth-success .as-check { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); display: grid; place-items: center; margin: 0 auto 20px; animation: asPop .35s cubic-bezier(.34,1.56,.64,1); }
.auth-success .as-check svg { width: 32px; height: 32px; color: var(--green); }
@keyframes asPop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.auth-success h2 { font-size: 23px; }
.auth-success p { font-size: 15px; color: var(--ink-2); margin-top: 8px; }
.auth-success .btn { margin-top: 24px; width: 100%; }

@media (max-width: 600px) {
  .auth-login-btn span { display: none; }
  .auth-login-btn { padding: 9px 11px; }
}

/* Fix: [hidden] must override display:flex so the transparent overlay doesn't block clicks */
.auth-overlay[hidden] { display: none !important; }
