/* ============================================================
   Cell Tech sign-in shell for the RepairGenie Bulk Uploader.

   Loaded AFTER Kelly's app.css. Everything here is scoped to the
   login view or to ct-* classes so the V1.4 uploader UI (.hero,
   .shell, .card, .stats, buttons, tables) is left completely alone.
   ============================================================ */

:root {
  --ct-bg: #f2f2f2;
  --ct-card: #ffffff;
  --ct-ink: #0a0a0a;
  --ct-ink-dim: #6e6e73;
  --ct-ink-faint: #a3a3a8;
  --ct-line-strong: rgba(0, 0, 0, 0.12);
  --ct-black: #111111;
  --ct-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.03);
  --ct-shadow-md: 0 2px 6px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.07);
  --ct-shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.07), 0 24px 60px rgba(0, 0, 0, 0.1);
  --ct-font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ct-font-brand: "Barlow Condensed", "Inter", sans-serif;
  --ct-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ct-ease-spring: cubic-bezier(0.34, 1.3, 0.44, 1);
  --ct-r-pill: 999px;
}

.hidden { display: none !important; }

/* ------------------------------------------------------------
   Boot + login (same design as the celltech.app portal login)
   ------------------------------------------------------------ */

.ct-boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--ct-bg);
  color: var(--ct-ink-dim);
  font-family: var(--ct-font-ui);
  font-size: 0.9rem;
  z-index: 50;
}

.ct-login {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--ct-bg);
  font-family: var(--ct-font-ui);
  color: var(--ct-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.ct-login-card {
  width: min(410px, 100%);
  padding: 52px 44px 38px;
  text-align: center;
  border-radius: 34px;
  background: var(--ct-card);
  box-shadow: var(--ct-shadow-lg);
  animation: ct-card-in 0.8s var(--ct-ease-out) both;
}

@keyframes ct-card-in {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.ct-login-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  object-fit: cover;
  margin-bottom: 22px;
  box-shadow: var(--ct-shadow-md);
}

.ct-login-title {
  margin: 0;
  font-family: var(--ct-font-brand);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ct-ink);
}

.ct-login-title-dim { font-weight: 500; color: var(--ct-ink-dim); }

.ct-login-sub {
  margin: 14px 0 30px;
  color: var(--ct-ink-dim);
  font-size: 0.92rem;
  line-height: 1.65;
}

.ct-google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 15px 20px;
  border-radius: var(--ct-r-pill);
  background: var(--ct-black);
  color: #fff;
  font-weight: 600;
  font-size: 0.94rem;
  text-decoration: none;
  box-shadow: var(--ct-shadow-md);
  transition: transform 0.25s var(--ct-ease-spring), box-shadow 0.25s ease, background 0.2s ease;
}

.ct-google-btn:hover {
  transform: translateY(-2px);
  background: #000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.ct-google-btn:active { transform: translateY(0) scale(0.99); }

.ct-login-error {
  margin-top: 18px;
  padding: 11px 14px;
  border-radius: 14px;
  background: #f5f5f5;
  border: 1px solid var(--ct-line-strong);
  color: #3a3a3c;
  font-size: 0.84rem;
  line-height: 1.5;
  text-align: left;
}

.ct-login-foot {
  margin: 26px 0 0;
  font-size: 0.76rem;
  color: var(--ct-ink-faint);
  letter-spacing: 0.02em;
}

.ct-login-foot strong { color: var(--ct-ink-dim); font-weight: 600; }

/* ------------------------------------------------------------
   Account bar that sits above Kelly's hero
   ------------------------------------------------------------ */

.ct-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--ct-font-ui);
  padding: 12px clamp(16px, 4.5vw, 56px);
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(242, 242, 242, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  z-index: 20;
}

.ct-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ct-ink);
  flex-shrink: 0;
}

.ct-brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: var(--ct-shadow-sm);
}

.ct-brand-name {
  font-family: var(--ct-font-brand);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.ct-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }

.ct-user-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 40px;
  width: 40px;
  gap: 0;
  padding: 4px;
  border-radius: 50%;
  background: var(--ct-card);
  box-shadow: var(--ct-shadow-sm);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  transition:
    width 0.4s var(--ct-ease-out),
    border-radius 0.35s var(--ct-ease-out),
    gap 0.3s ease,
    padding 0.35s var(--ct-ease-out),
    box-shadow 0.2s ease;
}

.ct-user-chip:hover,
.ct-user-chip:focus-within {
  width: 248px;
  border-radius: var(--ct-r-pill);
  gap: 10px;
  padding: 4px 6px 4px 4px;
  box-shadow: var(--ct-shadow-md);
}

.ct-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.ct-avatar-fallback {
  display: grid;
  place-items: center;
  background: var(--ct-black);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.ct-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.35s var(--ct-ease-out), opacity 0.22s ease;
}

.ct-user-chip:hover .ct-user-meta,
.ct-user-chip:focus-within .ct-user-meta { max-width: 160px; opacity: 1; }

.ct-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ct-user-role {
  font-size: 0.68rem;
  color: var(--ct-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ct-logout-btn {
  display: grid;
  place-items: center;
  width: 0;
  height: 32px;
  max-width: 0;
  opacity: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
  border: none;
  background: #eeeeee;
  color: var(--ct-ink-dim);
  cursor: pointer;
  flex: none;
  padding: 0;
  transition:
    max-width 0.35s var(--ct-ease-out),
    width 0.35s var(--ct-ease-out),
    opacity 0.22s ease,
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s var(--ct-ease-spring);
}

.ct-user-chip:hover .ct-logout-btn,
.ct-user-chip:focus-within .ct-logout-btn { width: 32px; max-width: 32px; opacity: 1; }

.ct-logout-btn:hover { color: #fff; background: var(--ct-black); transform: scale(1.06); }
.ct-logout-btn:active { transform: scale(0.96); }

@media (max-width: 520px) {
  .ct-brand-name { display: none; }
  .ct-login-card { padding: 42px 26px 32px; }
}
