/* ============================================================
   Ask Doc -- Auth Styles
   Full-page sign in/up gate + admin panel
   ============================================================ */

/* ── Full-page auth gate ── */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #0f1a2e 0%, #1B2B4B 40%, #243B5C 100%);
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px 0;
}
.auth-modal.visible {
  display: flex;
}

/* Hide the app entirely behind the auth gate */
body.auth-locked #app-header,
body.auth-locked .app-layout,
body.auth-locked .mobile-tab-bar,
body.auth-locked #toast-container {
  display: none !important;
}

.auth-backdrop { display: none; }

/* ── Branding header ── */
.auth-modal-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  justify-content: center;
  padding: 20px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
  flex-shrink: 0;
}

.auth-brand-logo {
  width: 420px;
  max-width: 90vw;
  height: auto;
  object-fit: contain;
  background: rgba(245, 242, 235, 0.95);
  border-radius: 24px;
  padding: 32px 40px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(201, 150, 59, 0.25);
}

/* ── Dialog card ── */
.auth-dialog {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(201, 150, 59, 0.25);
  border-radius: 20px;
  padding: 32px 36px;
  width: 90%;
  max-width: 400px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  font-family: 'Nunito', sans-serif;
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: color 0.2s;
}

.auth-tab.active {
  color: #C9963B;
  border-bottom: 2px solid #C9963B;
  margin-bottom: -1px;
}

.auth-tab:hover {
  color: rgba(255, 255, 255, 0.7);
}

/* ── Forms ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-form[hidden] {
  display: none !important;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.auth-form input {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  transition: border-color 0.2s, background 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: #C9963B;
  background: rgba(255, 255, 255, 0.08);
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.auth-submit {
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #C9963B, #D4A84B);
  color: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 4px;
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 150, 59, 0.3);
}

/* ── Error ── */
.auth-error {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.8rem;
  background: rgba(220, 53, 69, 0.15);
  color: #FF6B6B;
  text-align: center;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ── Links ── */
/* ── Divider ── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.auth-divider span {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── Google button ── */
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #E2E8F0;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.auth-google-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}
.auth-google-btn svg {
  flex-shrink: 0;
}

.auth-link {
  font-size: 0.8rem;
  text-align: center;
  color: #C9963B;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-guest-note {
  text-align: center;
  margin-top: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
}
.auth-guest-note a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}
.auth-guest-note a:hover {
  color: #C9963B;
}

/* ── Close button ── */
.auth-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  display: none; /* hidden since it's a full-page gate */
}

/* ── User Bar (header) ── */
.user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  padding: 0 8px;
}
.user-bar-login {
  padding: 6px 16px;
  border: 1.5px solid #C9963B;
  border-radius: 8px;
  background: none;
  color: #C9963B;
  font-family: 'Nunito', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.user-bar-login:hover { background: #C9963B; color: #fff; }
.user-bar-info { text-align: right; line-height: 1.2; }
.user-bar-name { font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.9); display: block; }
.user-bar-org { font-size: 0.65rem; color: rgba(255,255,255,0.5); display: block; }
.user-bar-actions { display: flex; gap: 6px; }
.user-bar-btn {
  width: 30px; height: 30px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.6);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.user-bar-btn:hover { border-color: #C9963B; color: #C9963B; }

/* ── Admin Panel ── */
.admin-panel { display: none; position: fixed; inset: 0; z-index: 9998; }
.admin-panel.visible { display: flex; align-items: center; justify-content: center; }
.admin-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.admin-dialog {
  position: relative;
  background: #1E2D3D;
  border: 1px solid rgba(201, 150, 59, 0.25);
  border-radius: 16px;
  width: 90%; max-width: 600px; max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  font-family: 'Nunito', sans-serif;
  overflow: hidden; display: flex; flex-direction: column;
  color: #E2E8F0;
}
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-header h2 { margin: 0; font-size: 1.1rem; color: #C9963B; }
.admin-close {
  background: none; border: none; font-size: 24px;
  color: rgba(255,255,255,0.4); cursor: pointer;
}
.admin-tabs {
  display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.1);
  overflow-x: auto; flex-shrink: 0;
}
.admin-tab {
  padding: 10px 16px; border: none; background: none; white-space: nowrap;
  font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 600;
  color: rgba(255,255,255,0.4); cursor: pointer; transition: all 0.2s;
}
.admin-tab.active { color: #C9963B; border-bottom: 2px solid #C9963B; }
.admin-content { overflow-y: auto; padding: 20px; flex: 1; }
.admin-section { margin-bottom: 20px; }
.admin-section h3 { margin: 0 0 12px; font-size: 0.9rem; color: #C9963B; }
.admin-error { color: #FF6B6B; }
.admin-btn {
  padding: 8px 20px; border: none; border-radius: 8px;
  font-family: 'Nunito', sans-serif; font-size: 0.8rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.admin-btn.primary { background: #C9963B; color: #fff; }
.admin-btn.primary:hover { background: #b8891f; }
.admin-btn.danger { background: #dc3545; color: #fff; }
.admin-btn.danger:hover { background: #c82333; }

/* ── Google status ── */
.google-status { padding: 16px; border-radius: 8px; background: rgba(255,255,255,0.04); }
.google-status.connected { border-left: 3px solid #34a853; }
.google-status.disconnected { border-left: 3px solid #ea4335; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.green { background: #34a853; }
.status-dot.red { background: #ea4335; }

/* ── Lists ── */
.gmail-item, .calendar-item, .drive-item {
  padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.gmail-item:last-child, .calendar-item:last-child, .drive-item:last-child { border-bottom: none; }
.gmail-meta, .calendar-meta, .drive-meta { font-size: 0.7rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.gmail-snippet { font-size: 0.8rem; color: rgba(255,255,255,0.5); margin-top: 4px; }
.meet-link {
  display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: 6px;
  background: #1a73e8; color: #fff; font-size: 0.7rem; text-decoration: none; font-weight: 600;
}

/* ── Org switcher ── */
.org-list { display: flex; flex-direction: column; gap: 6px; }
.org-item {
  padding: 10px 14px; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
  background: rgba(255,255,255,0.04); text-align: left;
  font-family: 'Nunito', sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; color: #E2E8F0;
}
.org-item span { font-weight: 400; font-size: 0.7rem; color: rgba(255,255,255,0.4); }
.org-item.active { border-color: #C9963B; background: rgba(201,150,59,0.1); }
.org-item:hover { border-color: #C9963B; }

/* ── Mobile ── */
@media (max-width: 600px) {
  .auth-modal { padding: 0; }
  .auth-modal-scroll { padding: 24px 16px 60px; justify-content: flex-start; }
  .auth-brand { margin-bottom: 20px; }
  .auth-brand-logo { width: 90vw; padding: 24px 28px; }
  .auth-dialog { padding: 24px 20px; width: 100%; max-width: none; }
  .admin-dialog { width: 95%; max-height: 90vh; }
  .user-bar-info { display: none; }
}
