/* ===== AUTH SCREENS ===== */
.os-auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  /* always-present fallback beneath photo layers */
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Photo carousel backdrop ───────────────────────────────────────────────── */
.os-auth-photos { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.os-auth-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.os-auth-photo.active {
  opacity: 1;
  animation-duration: 32s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
  animation-iteration-count: infinite;
}
.os-auth-photo--kb0.active { animation-name: os-kb-0; }
.os-auth-photo--kb1.active { animation-name: os-kb-1; }
.os-auth-photo--kb2.active { animation-name: os-kb-2; }
.os-auth-photo--kb3.active { animation-name: os-kb-3; }

@keyframes os-kb-0 { from { transform: scale(1.00) translate(  0%,  0%); } to { transform: scale(1.08) translate(-1.5%, -1%); } }
@keyframes os-kb-1 { from { transform: scale(1.00) translate(  0%,  0%); } to { transform: scale(1.08) translate( 1.5%, -1%); } }
@keyframes os-kb-2 { from { transform: scale(1.00) translate(  0%,  0%); } to { transform: scale(1.08) translate(-1.5%,  1%); } }
@keyframes os-kb-3 { from { transform: scale(1.00) translate(  0%,  0%); } to { transform: scale(1.08) translate( 1.5%,  1%); } }

@media (prefers-reduced-motion: reduce) {
  .os-auth-photo         { transition: none; }
  .os-auth-photo.active  { animation: none; opacity: 1; }
  .os-auth-photo:not(.active) { opacity: 0; }
}

/* Dark scrim for text legibility */
.os-auth-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,6,24,0.35) 0%,
    rgba(8,6,24,0.60) 60%,
    rgba(8,6,24,0.80) 100%
  );
  pointer-events: none;
}

/* Photo credit — bottom right */
.os-auth-credit {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.38);
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 1;
}

.os-auth-card {
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.28);
  border-radius: 24px;
  padding: 44px 40px 40px;
  min-width: 320px;
  max-width: 400px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: slide-up 350ms cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.06) inset,
    0 2px 40px rgba(0,0,0,0.45),
    0 8px 80px rgba(0,0,0,0.35);
}

.os-auth-card--wide {
  max-width: 480px;
  align-items: stretch;
}

.os-auth-logo { font-size: 3rem; line-height: 1; margin-bottom: 4px; }
.os-auth-logo-svg {
  display: block;
  width: 72px;
  height: 58px;
  margin-bottom: 6px;
}
.os-auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 20%, #93c5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.os-auth-subtitle { font-size: 0.875rem; color: rgba(255,255,255,0.55); }
.os-auth-error { font-size: 0.8rem; color: #f87171; margin-top: 8px; text-align: center; }

/* Legacy border-spinner — unused fallback */
.os-auth-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-top: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }


.os-auth-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.os-auth-signout {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 4px 12px;
  cursor: pointer;
  transition: all 150ms;
}
.os-auth-signout:hover { background: rgba(255,255,255,0.08); color: #fff; }

.os-ws-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.os-ws-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 150ms, border-color 150ms;
  color: #fff;
}
.os-ws-item:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }

.os-ws-icon { font-size: 1.5rem; flex-shrink: 0; }
.os-ws-info { flex: 1; }
.os-ws-name { font-size: 0.95rem; font-weight: 600; color: #fff; }
.os-ws-role { font-size: 0.75rem; color: rgba(255,255,255,0.45); text-transform: capitalize; margin-top: 2px; }

.os-ws-create { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }
.os-ws-create-btn {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color 150ms;
}
.os-ws-create-btn:hover { color: #fff; }

.os-auth-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 150ms;
}
.os-auth-input:focus { border-color: rgba(99,102,241,0.6); }
.os-auth-input::placeholder { color: rgba(255,255,255,0.3); }

.os-ws-create-go {
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}
.os-ws-create-go:hover { background: #4338ca; }

/* Workspace row with gear manage button */
.os-ws-item-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.os-ws-item-wrap .os-ws-item {
  flex: 1;
  width: auto;
}
.os-ws-manage-btn {
  flex-shrink: 0;
  opacity: 0.45;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 8px 10px;
  font-size: 0.85rem;
  transition: opacity 150ms, background 150ms;
}
.os-ws-item-wrap:hover .os-ws-manage-btn { opacity: 1; }
.os-ws-manage-btn:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* Manage view — back button */
.os-ws-back-btn {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 150ms;
}
.os-ws-back-btn:hover { color: #fff; }

/* Member list */
.os-member-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}
.os-member-loading {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  padding: 8px 0;
  text-align: center;
}
.os-member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
}
.os-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.os-member-info { flex: 1; min-width: 0; }
.os-member-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.os-member-email {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.os-member-role-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(99,102,241,0.25);
  color: #a5b4fc;
  border-radius: 6px;
  padding: 2px 8px;
  flex-shrink: 0;
}
.os-member-role-select {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
  background: rgba(99,102,241,0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99,102,241,0.3);
  border-radius: 6px;
  padding: 2px 6px;
  flex-shrink: 0;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: background 150ms, border-color 150ms;
}
.os-member-role-select:hover { background: rgba(99,102,241,0.3); border-color: rgba(99,102,241,0.5); }
.os-member-role-select option { background: #302b63; color: #fff; text-transform: capitalize; }

.os-member-remove {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 150ms, background 150ms;
  flex-shrink: 0;
}
.os-member-remove:hover { color: #f87171; background: rgba(248,113,113,0.12); }

/* Invite link button */
.os-share-invite-btn {
  width: 100%;
  padding: 11px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
  margin-top: 4px;
}
.os-share-invite-btn:hover { background: #4338ca; }

/* Google sign-in button (server-side OAuth flow) */
.os-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  padding: 11px 20px;
  width: 100%;
  max-width: 280px;
  background: #ffffff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms;
}
.os-google-btn:hover { background: #f8faff; box-shadow: 0 1px 3px rgba(60,64,67,0.3); }
.os-google-btn:active { background: #f1f3f4; }
.os-google-btn svg { flex-shrink: 0; }
